Components
Action bar
Floating bar with a selection count, bulk actions and a clear button for the selected rows of a list.
import { ActionBar, Button } from "@openperf/deft";
<ActionBar count={selected.size} onClear={clear}>
<Button.Root onClick={resolve} shape="pill" size="sm" variant="primary">
Resolve
</Button.Root>
</ActionBar>;When to use
| Need | Component |
|---|---|
| Actions on every selected row of a Table or Data table | Action bar |
| Actions that are always available, with or without a selection | Toolbar |
| Actions on a single row | Menu in that row |
Placement
ActionBar is a single component with no ActionBar.Root. Render it after the list, inside the same scrolling container: it sticks 20px above the bottom edge and centers itself.
Keep one main action visible as a small primary pill Button and put the rest in a Menu that opens upward with side="top".
Visibility
The bar renders nothing while count is 0. When count drops to 0, it keeps the last count and children on screen until the exit transition ends, then unmounts.
While rows are selected, Escape calls onClear from anywhere on the page, unless another handler already called preventDefault on the key event.
API
The count and both labels are Lingui messages, so the bar must render inside the root providers.
Prop
Type