Bulk action bar
Appears when rows are selected: select all, the count and the actions, and one toast to undo the batch.
| Deal | Owner | Stage | Value | |
|---|---|---|---|---|
| Acme Corp | Tara Mendes | €48,000 | ||
| Globex | Jon Park | €22,500 | ||
| Initech | Tara Mendes | €31,200 | ||
| Umbrella Health | Ada Novak | €9,800 | ||
| Stark Logistics | Jon Park | €64,000 |
Installation
npm i @uisatin/ui @uisatin/proimport '@uisatin/ui/styles.css'
import '@uisatin/pro/styles.css'
import { BulkActionBar } from '@uisatin/pro/bulk-action-bar'Part of Satin Pro, the licensed edition: @uisatin/pro on top of @uisatin/ui at the same version, its stylesheet after Free's. Satin Pro isn't on npm yet.
About 12.8 kB of JavaScript, minified and gzipped, on top of the @uisatin/uicomponents it uses (React aside).
First time with Satin? Set it up once, styles and fonts included, with the installation guide.
API Reference
The BulkActionBar component (Satin Pro, @uisatin/pro/bulk-action-bar) is a role="toolbar" that shows from count 1 and hides at 0. With total and onSelectAll it starts with a select-all Checkbox: indeterminate while some are selected, checked when all are; a click selects all, or clears when all are selected. The count sits in a grey Badge, and the clear button (×) at the end, after a rule. Each entry of actions and overflow is { label, icon, onSelect, tone, disabled, running }; an onSelect that returns a promise shows a Spinner until it settles. Parts: BulkActionBarRoot, BulkActionBarCount, BulkActionBarSeparator, BulkActionBarAction, BulkActionBarOverflow, BulkActionBarClear. With position="absolute", give the container position: relative and pb-16.
| Prop | Type | Default |
|---|---|---|
count | number | — |
onClear | () => void | — |
total | number | — |
onSelectAll | () => void | — |
actions | BulkAction[] | [] |
overflow | BulkAction[] | [] |
position | "sticky""absolute" | "sticky" |
wrapperClassName | string | — |
Accessibility
A toolbar named "Bulk actions" (bulkActions in SatinLabels), after the content it acts on. It starts with a "Select all" checkbox (aria-checked="mixed" while some are selected). The count is read out from a polite status region as it changes ("3 selected"), and "Selection cleared" or "Done" when that happens; the rolling digits are hidden from screen readers. The clear button carries aria-keyshortcuts="Escape"; the actions have no shortcuts. While hidden the bar is inert. When it hides with focus inside, focus goes back to where it came from (the row checkbox). The batch toast is read out like any toast; each item's Undo is named after the item ("Undo Acme Corp").
| Key | Action |
|---|---|
| Tab | Moves into the toolbar, onto the last button used, and out of it. |
| →or← | Moves to the next or previous button, wrapping around; mirrored right to left. |
| HomeorEnd | Moves to the first or last button. |
| Space | On the checkbox: selects all, or clears when all are selected. |
| EnterorSpace | Runs the focused action, opens the ⋯ menu, or clears with ×. |
| Esc | Clears the selection, while focus is in the table or the bar (not while typing in a field). |
Something wrong or missing on this page?
Report a problemSuggest an improvement