Set enableRowSelection: true to add a leading checkbox column. When rows are selected, a selection alert banner appears showing the current count.
enableRowSelection accepts a boolean or a (row) => boolean predicate (standard TanStack), so you can allow selecting only certain rows.
Stable selection keys
Always provide getRowId so selection keys stay stable across re-renders,
sorting, and pagination. Without it, selection is keyed by row index and can
drift.
row-selection
Multi-row selection with a select-all checkbox in the header.
Row selectionMulti-row selection with an alert banner.
Read the current selection at any time. To show it in your own component's render, subscribe to it with stateSelector (the component holding the table does not re-render on table changes by default; see State management):
Click one row's checkbox, then shift-click another: every row between them takes the same state — selected, or cleared if the shift-clicked row was selected. Ranges follow the rows as displayed (sorted and filtered). Turn it off with enableBatchRowSelection: false.
Bulk actionsDelete the selected rows from a toolbar button.
The selection column header carries a select-all checkbox. selectAllMode controls its scope — "page" (default) toggles the current page, "all" toggles every row across pages. Set enableSelectAll: false to hide the header checkbox entirely.
positionToolbarAlertBanner places the banner with the selected count and Clear selection: "top" (default, between the toolbar and the table), "bottom" (under the table), "head-overlay" or "none".
With "head-overlay" (as in Material React Table) the banner lies over the header row instead, with the select-all checkbox at its start, so selecting rows never pushes the table down. It stays over a sticky header while the table scrolls, spans the visible width when it scrolls sideways, and goes away when nothing is selected, leaving the header clickable again. If you Tab into a header control while it shows, it steps aside until focus leaves the header row. It needs the table head (enableTableHead).
Selection banner over the headerThe selection banner lies over the header row.
Show the select-all checkbox in the selection column header. Default true.
selectAllMode?
"page" | "all"
"page"
Select-all scope for the header checkbox: the current page ("page", default) or every row ("all").
enableBatchRowSelection?
boolean
true
Shift-click a row's checkbox to select (or clear) every row since the last one clicked. Default true.
positionToolbarAlertBanner?
"top" | "bottom" | "head-overlay" | "none"
"top"
Where the row-selection alert banner renders: above the table (`"top"`, default), below it (`"bottom"`), over the header row (`"head-overlay"`, with the select-all checkbox, so selecting rows does not move the table; needs the table head), or nowhere (`"none"`).