Skip to content
satin

Bulk action bar

Pro

Appears when rows are selected: select all, the count and the actions, and one toast to undo the batch.

DealOwnerStageValue
Acme CorpTara Mendes
Proposal
€48,000
GlobexJon Park
Qualified
€22,500
InitechTara Mendes
Proposal
€31,200
Umbrella HealthAda Novak
Lead
€9,800
Stark LogisticsJon Park
Won
€64,000

    Installation

    Terminal
    npm i @uisatin/ui @uisatin/pro
    Import
    import '@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.

    PropTypeDefault
    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").

    KeyAction
    TabMoves 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.
    HomeorEndMoves to the first or last button.
    SpaceOn the checkbox: selects all, or clears when all are selected.
    EnterorSpaceRuns the focused action, opens the ⋯ menu, or clears with ×.
    EscClears the selection, while focus is in the table or the bar (not while typing in a field).