Components
Selectable Data Table
DataTable plus row selection — a leading checkbox column and a live selected-count line.
Everything about sorting, loading, error, and the phone card fallback is inherited unchanged from
DataTable — this only adds the checkbox column, the select-all header (indeterminate when some but not
all rows are checked), and a live "N selected" line above the table.
None selected
| First Passage to the West | 2 | GoldLeaf | |
| Journey through the Clouds | 2 | SilverLeaf | |
| Rainforest to Gold Rush | 2 | GoldLeaf |
- __selectRouteFirst Passage to the WestDays2ServiceGoldLeaf
- __selectRouteJourney through the CloudsDays2ServiceSilverLeaf
- __selectRouteRainforest to Gold RushDays2ServiceGoldLeaf
Props
Prop
Type
Accessibility
- Selection is keyed by
getRowId, not array index — pass it whenever the table can re-sort or refetch, so a checked row stays checked as the same row, not whatever row happens to land at that index next. - Provide
getRowLabelso each row's checkbox gets a real accessible name (e.g. "Select First Passage to the West") instead of a generic "Select row" repeated for every checkbox.
Do / Don't
- Do read selected rows from
onSelectionChange's originals, not from re-deriving them offrowSelectionstate yourself — the callback already gives you the selected row objects. - Don't reach for this when nothing on the page acts on a selection (bulk delete, bulk export, etc.) —
a checkbox column with no action behind it is a UI promise the screen doesn't keep. Use plain
DataTable.