Bulk Action Bar
ProNewA floating toolbar that rises while rows are selected, with a live count, actions and Escape to clear.
Installation
pnpm dlx shadcn@latest add @viewport/bulk-action-bar
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
<BulkActionBar>
| Prop | Type | Default |
|---|---|---|
| count* | numberHow many rows are selected. The bar is shown while this is above zero. | — |
| onClear* | () => voidClears the selection. Also runs on Escape. | — |
| noun | stringWhat is selected, e.g. "contact". The plural adds an "s"; pass `nounPlural` when that is wrong. | "item" |
| nounPlural | string | — |
| children* | React.ReactNodeThe actions: buttons, menus. | — |
| position | "fixed" | "sticky"`fixed` pins the bar to the viewport; `sticky` keeps it at the bottom of its scrolling container. | "sticky" |
| className | string | — |
<BulkAction>
| Prop | Type | Default |
|---|---|---|
| icon | React.ReactNode | — |
| variant | "default" | "destructive"`destructive` colors the action for deletes. | "default" |
Accessibility
- A toolbar that is inert while hidden, so Tab never lands in it.
- The count is a status and is announced as the selection changes.
- Escape clears the selection unless a menu, dialog or field has it.
- Respects prefers-reduced-motion.