Skip to content

Components

BulkBar: what to do with the selection

BulkBar appears when rows of a list are selected: a dark bar floating at the bottom of the screen with the count, the actions and a button that clears the selection. It never pushes the table down, and an action that applies to only some of the rows says so, like Send 3 reminders of 4.

By Bohuslav PoláčekChecked

Kestrel's payment reminders with the three invoices that can be reminded selected, then all four, then only the one that cannot be, and Riverside's payments with two court bookings and their total, rendered from the kit. In the app the bar floats at the bottom of the window; here each sits at the foot of its own strip.

What it is for, and what the preview shows

BulkBar is what a list shows once rows are ticked in a DataTable. It counts the selection, offers the actions that apply to it, and clears it with one button, while the table above stays where it was. Its actions are Button variant="inverse", the light-on-dark buttons made for the bar.

The preview shows the payment reminders of Kestrel, an accounting practice in the demo: four overdue invoices, one of them for a client whose reminders are off. With the other three selected, the action reads Send 3 reminders. With all four, it reads Send 3 reminders of 4. With only that one, the action stays in the bar, disabled, and its tooltip gives the reason. The last bar is from Riverside's payments, where summary adds the total of two court bookings after the count.

The rules, and where each one lives

  • A bulk action says how many rows it applies to. "Approve 2 of 5", in the root AGENTS.md (Tables) and in docs/principles.md (Fewer choices at once), instead of a column of buttons on every row; docs/patterns.md names Kestrel's reminders as the example.
  • It floats, it never pushes. The bar is fixed to the bottom of the window, so the table does not move when the first row is ticked (the manifest's summary), and ticking never changes a row's height (AGENTS.md; the audit's row-heights).
  • A row that cannot take part says why. DataTable's getRowSelectBlockedReason puts the reason on a disabled checkbox; docs/patterns.md pairs it with BulkBar.
  • Every row keeps its checkbox slot. Each box is 24 by 24px with its label (AGENTS.md; the audit's target-size).
  • Not for one record. One record's actions belong in its header or behind a DropdownMenu (the manifest's not).
  • Named for screen readers. The bar is a region with its own name that says how many rows are selected, and its clear button, an icon alone, has a label, as AGENTS.md (Accessibility) asks of every icon-only button.

What AI coding tools write instead

The manifest's replaces: a hand-built toolbar for selected rows. An assistant usually renders a row of buttons above the table that appears when something is ticked, or a column of buttons on every row.

A toolbar that appears above the table pushes every row down the moment the first box is ticked, so the row under the pointer jumps. Its buttons say Send reminders whatever the selection holds, and a row that cannot take the action fails after the click instead of saying so before it. Buttons on every row multiply the choices on screen and crowd the columns a phone needs. BulkBar keeps the table still, the count in view and each action honest about how many rows it touches.

How to use it

The props, from BulkBar's signature:

  • count: how many rows are selected; at zero the bar renders nothing.
  • onClear: clears the selection, from the bar's close button.
  • summary: what the selection adds up to, after the count in a quieter weight (a total, hours).
  • children: the actions, Button size="sm" variant="inverse"; a disabled one goes inside a Tooltip that gives the reason.

Take the selection from DataTable with enableSelection and onSelectionChange, block rows with canSelectRow and getRowSelectBlockedReason, and change selectionResetKey after the action to clear the ticks. Bulk actions are part of the list pattern.

Its entry in the manifest

The component's rules as the kit's manifest states them, the same entry an AI coding tool reads.Read from the kit's component manifest when the site was built (126 components, packages/kit/src/components.json); the same entry answers an AI coding tool through the kit's MCP server.

Where it runs in the example apps

The example apps whose code renders BulkBar, and in which modules, read from the demo's source.Read from the demo's source when the site was built: 9 of 9 example apps render <BulkBar>, in the modules named here as each app's sidebar names them.

How Kestrel's reminders call it

apps/demo/src/modules/invoicing/pages/reminders.tsx
<BulkBar count={count} onClear={onClear}>
  {canRemind ? (
    eligible ? (
      <Button size="sm" variant="inverse" onClick={onSend} loading={busy}>
        <IconBell aria-hidden="true" />
        {eligible === count
          ? tx(`Poslat ${remindersToSend(eligible)}`, `Send ${remindersToSend(eligible)}`)
          : tx(`Poslat ${remindersToSend(eligible)} z ${count}`, `Send ${remindersToSend(eligible)} of ${count}`)}
      </Button>
    ) : (
      <Tooltip
        content={tx("Vybrané faktury teď upomenout nejde.", "The selected invoices cannot be reminded right now.")}
      >
        <span className="inline-flex">
          <Button size="sm" variant="inverse" disabled>
            <IconBell aria-hidden="true" />
            {tx("Poslat upomínku", "Send reminder")}
          </Button>
        </span>
      </Tooltip>
    )
  ) : null}
  <Button size="sm" variant="inverse" onClick={onExport}>
    <IconDownload aria-hidden="true" />
    {tx("Exportovat", "Export")}
  </Button>
</BulkBar>
The send action counts only the invoices that can be reminded and adds "of 4" when that is fewer than the selection; with none it stays, disabled, with the reason in its tooltip.

Questions

Why does the bar float instead of sitting above the table?

So the table never moves. A toolbar that appears above the rows pushes them down the moment the first box is ticked; the floating bar leaves every row where it was.

What should an action say when it applies to only some rows?

How many it applies to out of the selection, like Send 3 reminders of 4. When it applies to none, it stays in the bar, disabled, with the reason in its tooltip.

Can the bar show what the selection adds up to?

Yes. The summary prop puts a total after the count in a quieter weight, such as the amount of the selected bookings or the hours of the selected entries.

Is BulkBar for the actions of a single record?

No. One record's actions belong in its header or behind its menu. BulkBar is for several rows of a list at once.

Two ways

Build it yourself, or have it built

  • Build it yourself

    Build your app on the framework

    Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.

    One payment, lifetime updates

    Get the framework
  • Have it built

    Have us build your app

    Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.

    After launch, Care keeps it improving, from €99 a month.

    from €1,990

    Describe your app