SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

selectionBarSync

Why JS: counting checked rows elsewhere on the page, announcing the count and the Escape and action keys need script.

tsx
import { selectionBarSync } from "@sdxc/ui/app";

Usage

Wires the bar around its host ([data-slot="selection-bar"]) to the target region; the host itself is the polite live region. The bar shows data-state="selecting" while any row is checked, its hidden layer is inert, and the count stays on the last non-zero value so the bar fades out still naming what was selected.

Signature

typescript
selectionBarSync(options: SelectionBarSync.Options): MixinDescriptor<HTMLElement>

Parameters

ParameterTypeRequiredDescription
optionsSelectionBarSync.OptionsYes

Examples

tsx
<span role="status" mix={[selectionBarSync({ target: "monitors", selected: "{count} selected", cleared: "Selection cleared" })]} />

The events, constants and types its module publishes, each imported from @sdxc/ui/app too.

Interface

SelectionBarSync.Options

Configuration for selectionBarSync.

MemberTypeRequiredDescription
targetstringYesThe id of the region holding the rows' checkboxes.
selectedstringYesThe visible and announced count, with {count} replaced, such as "{count} selected".
clearedstringYesWhat is announced once the selection empties, such as "Selection cleared".
localestringNoLocale for the count. Defaults to the runtime's.
@sdxc/ui

Can’t find it? Contact us