DataGridTable
Renders the virtualised header and body rows for a DataGrid.
Consumes the surrounding DataGrid context, so it must live inside a DataGrid
provider and shell. Rows are windowed with @tanstack/react-virtual.
Usage
Best practices
Render inside
DataGrid(and its shell) - it callsuseDataGrid()for the table and layout and throws outside the provider; it takes notableprop of its own.Sorting and filtering come from the column definitions: a plain-text
headersorts on click, andmeta: { filter: true }adds a values menu. Build the table withuseDataGridTableand pair it withPageToolbarTableFilters/PageToolbarTableSortabove the grid; all of them share one state.Rows are virtualised, so give each a stable
rowHeightviatableLayout(expanded rows useexpandedRowHeight) - variable, unmeasured heights make the window jump.Use
DataGridTablefor a data-driven grid; for a small static table with hand-authored<TableRow>s reach forTableinstead - no virtualisation or TanStack instance needed.
Props
DataGridTableBase
DataGridTableBody
DataGridTableBodyRow
DataGridTableBodyRowCell
DataGridTableBodyRowExpandded
DataGridTableBodyRowSkeleton
DataGridTableBodyRowSkeletonCell
DataGridTableHead
DataGridTableHeadRow
DataGridTableHeadRowCell
DataGridTableHeadRowCellResize
DataGridTableRowSelect
DataGridTableRowSelectAll
Also exports
- component
DataGridTable - component
DataGridTableEmpty - component
DataGridTableLoader - component
DataGridTableRowSpacer