Row selection

Letting the user select whole rows with selectable.rows.

Last updated August 3, 2026

selectable.rows takes false, "single", or "multiple" — off by default, since selection claims the click a display-only grid shouldn't. Give getRowId alongside it for data that sorts, filters, or pages; without one a row is identified by its position, so a re-sort leaves the same positions selected under different rows.

Multi-select rows

selectable={{ rows: "multiple" }}

Live example
IdServiceEnvironment NameEnvironment RegionStatusCost
1checkout-apiproductionus-east-1healthy1240.5
2billing-workerproductioneu-west-1degraded860.2
3search-indexstagingus-east-1healthy92.75
4notificationsproductionus-west-2down305.4
5analytics-pipelinestagingeu-west-1healthy145
  1. Interact with the grid above to see its callbacks fire.
<DataGridComponent
  columns={columns}
  dataSource={rows}
  getRowId={(row) => String(row.Id)}
  selectable={{ rows: "multiple" }}
  onRowSelectionChange={({ selected }) => persist(selected)}
/>;

Props

PropTypeDefaultDescription
selectable.rowsfalse | "single" | "multiple"falseHow many rows the user may select at once.
getRowId(row: Row, index: number) => stringrow positionA row's stable identity. Give one for data that sorts, filters, or pages, or a selection follows the position rather than the row.
defaultRowSelectionSelectionStateRow ids selected to start with, keyed as getRowId resolves them. Uncontrolled.
onRowSelect / onRowsSelect(event) => voidOnce per row newly selected, and once per interaction with every row it selected.
onRowDeselect / onRowsDeselect(event) => voidThe deselecting counterpart of each, above.
onRowSelectionChange(event: RowSelectionChangeEvent) => voidOnce per change with what it added, what it removed, and everything selected after — the one to persist from.
Edit this page on GitHub