Shadcn React Table

Search documentation

Search the docs

DataTable props

<DataTable /> is mostly driven by the instance from useDataTable. It accepts the presentational props below, and spreads any other div props onto the root element.

PropTypeDescription
table#DataTableInstance<TData>The instance returned by `useDataTable`.
tsx
<DataTable table={table} className="mx-auto max-w-5xl" />

Styling inner parts

To reach the scroll surface, rows, cells or any other part, use the slotProps option on useDataTable — for example slotProps: { surface: { className: "max-h-[600px]" } } bounds the scroll surface for a sticky header or a virtualized list.