Table Selection Toolbar
@astryxdesign/core v0.7.1 · TableSelectionToolbar
Props
| Prop | Type | Default | Description |
|---|---|---|---|
count | number | 0 | How many rows are selected. Used when selection is not given. |
selection | TableSelectionState | — | The selectionState returned by useTableSelectionState. Takes over from count and drives the clear command. |
label | string | Built-in copy | Accessible name for the action surface. Defaults to Bulk actions. |
clearLabel | string | Built-in copy | Visible 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. |
variant | SectionVariant | '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. Withselectionpassed, the bar empties the selected keys itself before emitting.
Slots
| Slot | Slot props | Description |
|---|---|---|
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.