Skip to main content

<DataTable />

Single entry component for server and client tables.

Props​

PropTypeDescription
columnsColumnDef<T>[]TanStack columns
source{ type: "server", options } | { type: "client", data }Data source
initialStatePartial table state + sortingInitial sort/visibility/pinning
getRowId(row) => stringStable row id
rowIdKeykeyof TFallback id field if no getRowId
enableRowSelectionbooleanCheckbox column + selection
enableToolbarbooleanSort/filter toolbar
enableAdvancedFilterbooleanAllow advanced mode toggle
enablePaginationbooleanPagination footer
showTotalRowsbooleanShow total beside page size
actionBarReactNode | (table) => ReactNodeBulk actions when selected
toolbarChildrenReactNodeExtra toolbar controls
onSelectionChange(rows) => voidSelection callback
disableParamPersistencebooleanKeep state in memory (dialogs)
fillHeightbooleanStretch body for dialogs
stickyHeaderbooleanSticky column headers
tableId / tableNamestringIncluded in cell edit events
onCellEdit(event) => voidInline edit commit
classNamestringWrapper class

Subcomponents (advanced)​

Also exported for custom layouts:

  • DataTableContent — table shell + pagination
  • DataTableToolbar / DataTableAdvancedToolbar
  • DataTableFilterList / DataTableSortList
  • DataTablePagination / DataTableColumnHeader
  • DataTableEditableCell / DataTableSkeleton

Internal wiring​

  1. Optional DataTableLocalStateProvider when URL persistence is off
  2. useServerTableData when source.type === "server"
  3. useDataTable binds TanStack ↔ URL/local state
  4. Toolbar switches simple ↔ advanced based on filterFlag / URL filters

See Architecture.