← Inventory
DataGridTable
Renders the virtualized 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.
| Material | Substrate | Finish | |
|---|---|---|---|
| Carrara Marble | Stone | Honed | |
| White Oak Plank | Wood | Matte | |
| Basalt Slab | Stone | Polished |
Usage
import { DataGridTable, DataGridTableBase, DataGridTableBody, DataGridTableBodyRow, DataGridTableBodyRowCell, DataGridTableBodyRowExpandded, DataGridTableBodyRowSkeleton, DataGridTableBodyRowSkeletonCell, DataGridTableEmpty, DataGridTableHead, DataGridTableHeadRow, DataGridTableHeadRowCell, DataGridTableHeadRowCellResize, DataGridTableLoader, DataGridTableRowSelect, DataGridTableRowSelectAll, DataGridTableRowSpacer } from "@desk/ui/components/data-grid-table";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.Rows are virtualized, 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 virtualization or TanStack instance needed.
Props
DataGridTableBase
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode |
DataGridTableBody
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode |
DataGridTableBodyRow
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | ||
| row | Row<TData> | ||
| dndRef | React.Ref<HTMLTableRowElement> | ||
| dndStyle | React.CSSProperties | ||
| dataIndex | number |
DataGridTableBodyRowCell
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | ||
| cell | Cell<TData, unknown> | ||
| dndRef | React.Ref<HTMLTableCellElement> | ||
| dndStyle | React.CSSProperties |
DataGridTableBodyRowExpandded
| Prop | Type | Default | Description |
|---|---|---|---|
| row | Row<TData> |
DataGridTableBodyRowSkeleton
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode |
DataGridTableBodyRowSkeletonCell
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | ||
| column | Column<TData, unknown> |
DataGridTableHead
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode |
DataGridTableHeadRow
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | ||
| headerGroup | HeaderGroup<TData> |
DataGridTableHeadRowCell
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | ||
| header | Header<TData, unknown> | ||
| dndRef | React.Ref<HTMLTableCellElement> | ||
| dndStyle | React.CSSProperties |
DataGridTableHeadRowCellResize
| Prop | Type | Default | Description |
|---|---|---|---|
| header | Header<TData, unknown> |
DataGridTableRowSelect
| Prop | Type | Default | Description |
|---|---|---|---|
| row | Row<TData> | ||
| size | "base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl" |
DataGridTableRowSelectAll
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl" |
Also exports
- component
DataGridTable - component
DataGridTableEmpty - component
DataGridTableLoader - component
DataGridTableRowSpacer