# Bulk Action Bar

> The floating bar that rises when rows are selected: a rolling count with Clear and Select all, actions with single-key shortcuts and a More menu. Destructive actions ask in place, async ones spin, and a returned result turns the bar into "3 files archived · Undo" with a draining line that pauses on hover. Escape clears; labels fold to icons when narrow.

- Slug: `bulk-action-bar`
- Category: [Menus](https://www.assembli.design/category/menus.md)
- Type: component
- Tags: bulk-actions, selection, toolbar, floating, undo, shortcuts, table
- npm dependencies: @base-ui/react, lucide-react, motion
- shadcn/ui dependencies: none
- Live preview: https://www.assembli.design/preview/bulk-action-bar
- Page: https://www.assembli.design/components/bulk-action-bar

![Bulk Action Bar preview](https://www.assembli.design/thumbnails/bulk-action-bar-light.png)

## Props

Other props pass through to the root element.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `count` (required) | `number` |  | How many items are selected. The bar shows while this is above 0. |
| `total` | `number` |  | All items that could be selected. Enables "Select all". |
| `noun` | `{ one: string; other: string }` | `{ one: "item", other: "items" }` | What's being selected: `{ one: "issue", other: "issues" }`. |
| `onSelectAll` | `() => void` |  |  |
| `onClear` (required) | `() => void` |  |  |
| `actions` (required) | `BulkAction[]` |  |  |
| `maxVisible` | `number` | `4` | Actions shown as buttons before the rest fold into "More". |
| `position` | `"fixed" \| "absolute"` | `"fixed"` | `fixed` floats over the page; `absolute` floats over the nearest positioned ancestor (a table card, a pane). |
| `shortcuts` | `boolean` | `true` | Let shortcuts and Escape work from anywhere on the page while the bar shows. Defaults to `true`. |
| `resultDuration` | `number` | `5000` | How long a result stays up, in ms. Hovering pauses it. |

## Install

One-time setup (needs a subscription):

1. Add the registry to the project's `components.json`: `{"@assembli":{"url":"https://www.assembli.design/r/{name}.json","headers":{"Authorization":"Bearer ${ASSEMBLI_API_KEY}"}}}` (merge into `"registries"`).
2. Put an API key from https://www.assembli.design/account in `.env.local` as `ASSEMBLI_API_KEY=asm_…`.

Then install with the shadcn CLI (writes `components/bulk-action-bar/bulk-action-bar.tsx` and installs dependencies):

```bash
npx shadcn@latest add @assembli/bulk-action-bar
```

Registry item JSON: https://www.assembli.design/r/bulk-action-bar.json (send `Authorization: Bearer <api key>`)

## Code

> Component source needs an Assembli subscription ($12/month or $96/year) and an API key sent as `Authorization: Bearer <key>`. To get one without copying anything, POST https://www.assembli.design/api/agent/login (or call the MCP tool connect_account), show the user the link it returns, and poll https://www.assembli.design/api/agent/token for the key. Or subscribe at https://www.assembli.design/pricing and create a key at https://www.assembli.design/account.
