Skip to content

Table Selection Toolbar

@astryxdesign/core v0.7.1 · TableSelectionToolbar

Props ​

PropTypeDefaultDescription
countnumber0How many rows are selected. Used when selection is not given.
selectionTableSelectionState—The selectionState returned by useTableSelectionState. Takes over from count and drives the clear command.
labelstringBuilt-in copyAccessible name for the action surface. Defaults to Bulk actions.
clearLabelstringBuilt-in copyVisible label of the command that clears the whole selection. Defaults to Unselect All.
size'sm' | 'md' | 'lg''sm'Height of the bar. The clear command follows it.
variantSectionVariant'muted'Surface of the bar: section uses the surface colour, muted the muted background, transparent none.

Events ​

  • clear(): fires when the clear command is clicked. With selection passed, the bar empties the selected keys itself before emitting.

Slots ​

SlotSlot propsDescription
start—Product actions, aligned to the logical start. Child controls do not inherit size, so set it on them.
default—Same place as start. Kept for older code; start wins when both are given.
label{ count: number }Replaces the visible count text for localisation or domain-specific copy.

Native attributes ​

The root element is a <div> with role="toolbar" and aria-orientation="horizontal".

The root element receives:

  • HTML attributes.
  • aria-* attributes.
  • data-* attributes.
  • class.
  • style.
  • Native event listeners.

Three strings come from the locale messages: the accessible name (Bulk actions), the count text ({count} selected), and the clear label (Unselect All). They switch to Chinese after provideAstryxLocale('zh-CN'), and label, clearLabel, and the label slot replace them one by one.

When selection is passed and nothing is selected, the bar renders nothing at all. The count form always renders, so a bar mounted for a fixed count keeps its place.

Two React-only props are not in the Vue API: xstyle becomes class or style, and the whole toolbar is placed by the surrounding layout. renderSelectionLabel and startContent become the label and start slots.