useTableSelectionState
@astryxdesign/core v0.7.1 · useTableSelectionState
Usage
State management companion for useTableSelection. Returns selectionConfig for the behaviour plugin plus selectionState for selection-aware UI such as TableSelectionToolbar. The selection itself stays controlled: you own the Set of selected keys and pass a setter. Select-all only takes the rows that can be checked, so rows that are not selectable or are disabled keep whatever state they had. idKey takes a property name or a function that returns the key.
ts
import { useTableSelectionState } from '@astryx-vue/core/Table'Examples
useTableSelectionState — Row Selection
Name | Email | Role | |
|---|---|---|---|
| Alice | alice@example.com | Engineer | |
| Bob | bob@example.com | Designer | |
| Charlie | charlie@example.com | Manager | |
| Diana | diana@example.com | Engineer | |
| Eve | eve@example.com | Admin |
Table with row selection checkboxes and a select-all header checkbox. The checked keys and the setter stay in the caller, and selectionState mirrors them for selection-aware UI such as a toolbar.