Skip to content
← 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.

MaterialSubstrateFinish
Carrara MarbleStoneHoned
White Oak PlankWoodMatte
Basalt SlabStonePolished

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 calls useDataGrid() for the table and layout and throws outside the provider; it takes no table prop of its own.

  • Rows are virtualized, so give each a stable rowHeight via tableLayout (expanded rows use expandedRowHeight) — variable, unmeasured heights make the window jump.

  • Use DataGridTable for a data-driven grid; for a small static table with hand-authored <TableRow>s reach for Table instead — no virtualization or TanStack instance needed.

Props

DataGridTableBase

PropTypeDefaultDescription
children(required)React.ReactNode

DataGridTableBody

PropTypeDefaultDescription
children(required)React.ReactNode

DataGridTableBodyRow

PropTypeDefaultDescription
children(required)React.ReactNode
row(required)Row<TData>
dndRefReact.Ref<HTMLTableRowElement>
dndStyleReact.CSSProperties
dataIndexnumber

DataGridTableBodyRowCell

PropTypeDefaultDescription
children(required)React.ReactNode
cell(required)Cell<TData, unknown>
dndRefReact.Ref<HTMLTableCellElement>
dndStyleReact.CSSProperties

DataGridTableBodyRowExpandded

PropTypeDefaultDescription
row(required)Row<TData>

DataGridTableBodyRowSkeleton

PropTypeDefaultDescription
children(required)React.ReactNode

DataGridTableBodyRowSkeletonCell

PropTypeDefaultDescription
children(required)React.ReactNode
column(required)Column<TData, unknown>

DataGridTableHead

PropTypeDefaultDescription
children(required)React.ReactNode

DataGridTableHeadRow

PropTypeDefaultDescription
children(required)React.ReactNode
headerGroup(required)HeaderGroup<TData>

DataGridTableHeadRowCell

PropTypeDefaultDescription
children(required)React.ReactNode
header(required)Header<TData, unknown>
dndRefReact.Ref<HTMLTableCellElement>
dndStyleReact.CSSProperties

DataGridTableHeadRowCellResize

PropTypeDefaultDescription
header(required)Header<TData, unknown>

DataGridTableRowSelect

PropTypeDefaultDescription
row(required)Row<TData>
size"base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl"

DataGridTableRowSelectAll

PropTypeDefaultDescription
size"base" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl"

Also exports

  • componentDataGridTable
  • componentDataGridTableEmpty
  • componentDataGridTableLoader
  • componentDataGridTableRowSpacer

Composition

Builds on

DataGrid, Spinner