Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Bulk Action Bar

ProNew

A 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>

PropTypeDefault
count*number

How many rows are selected. The bar is shown while this is above zero.

—
onClear*() => void

Clears the selection. Also runs on Escape.

—
nounstring

What is selected, e.g. "contact". The plural adds an "s"; pass `nounPlural` when that is wrong.

"item"
nounPluralstring—
children*React.ReactNode

The actions: buttons, menus.

—
position"fixed" | "sticky"

`fixed` pins the bar to the viewport; `sticky` keeps it at the bottom of its scrolling container.

"sticky"
classNamestring—

<BulkAction>

PropTypeDefault
iconReact.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.