Prodular UI

Bulk action bar

A toolbar for the selected items: count, select all and clear, actions with single key shortcuts, a More menu for the rest, loading per action, and confirmation for destructive ones.

npx prodular-ui add bulk-action-bar

Invoices

Three actions as buttons, the rest under More. Press R, A, E or D while the bar is open; Escape clears. Delete confirms first; Archive is disabled with a reason.

  • INV-2104Northwind Logistics$5,900
  • INV-2103Kestrel Health$8,420
  • INV-2102Halcyon Robotics$11,227
  • INV-2101Meridian Freight$622
  • INV-2100Lumen Analytics$3,591

Anatomy

<BulkActionBar  count={selected.length}  total={rows.length}  onClear={clear}  actions={[{ id: "archive", label: "Archive", shortcut: "e", onAction: archive }]}/>

Guidance

Use it when

  • Lists, tables and boards where people select several items and act on all of them.
  • Three visible actions for the common ones, the rest in More.
  • shortcut for actions people repeat, like archive or assign.

Avoid

  • Actions for one item. Put those in the row menu.
  • Hiding unavailable actions. Disable them with a reason so people learn why.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Render the bar inside the list's relative container with position floating, or inline above the list.
  • Pass count and onClear; add total and onSelectAll to offer Select all.
  • Make onAction async; the button shows a spinner and the others wait. Throw to show the error in the bar.
  • Destructive actions confirm through Destructive confirm unless confirm is false. Put counts in the confirmation title.
  • Shortcuts are single keys without modifiers and do nothing while people type in a field or a dialog is open.

API

BulkActionBar

PropTypeDefaultDescription
count / totalnumberSelected and selectable items. Hidden at 0.
onClear / onSelectAll() => voidClear selection (also Escape) and select everything.
noun[string, string]["item", "items"]Singular and plural for the count.
actionsBulkAction[]{ id, label, icon?, shortcut?, variant?, onAction, confirm?, disabled? }.
maxVisiblenumber3Buttons before More.
position"floating" | "inline""floating"Over the bottom of the container, or in the flow.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add bulk-action-bar# or, with the registry in components.jsonnpx shadcn@latest add @prodular/bulk-action-bar