<DataTable />
Single entry component for server and client tables.
Props
| Prop | Type | Description |
|---|---|---|
columns | ColumnDef<T>[] | TanStack columns |
source | { type: "server", options } | { type: "client", data } | Data source |
initialState | Partial table state + sorting | Initial sort/visibility/pinning |
getRowId | (row) => string | Stable row id |
rowIdKey | keyof T | Fallback id field if no getRowId |
enableRowSelection | boolean | Checkbox column + selection |
enableToolbar | boolean | Sort/filter toolbar |
enableAdvancedFilter | boolean | Allow advanced mode toggle |
enablePagination | boolean | Pagination footer |
showTotalRows | boolean | Show total beside page size |
actionBar | ReactNode | (table) => ReactNode | Bulk actions when selected |
toolbarChildren | ReactNode | Extra toolbar controls |
onSelectionChange | (rows) => void | Selection callback |
disableParamPersistence | boolean | Keep state in memory (dialogs) |
fillHeight | boolean | Stretch body for dialogs |
stickyHeader | boolean | Sticky column headers |
tableId / tableName | string | Included in cell edit events |
onCellEdit | (event) => void | Inline edit commit |
className | string | Wrapper class |
Subcomponents (advanced)
Also exported for custom layouts:
DataTableContent— table shell + paginationDataTableToolbar/DataTableAdvancedToolbarDataTableFilterList/DataTableSortListDataTablePagination/DataTableColumnHeaderDataTableEditableCell/DataTableSkeleton
Internal wiring
- Optional
DataTableLocalStateProviderwhen URL persistence is off useServerTableDatawhensource.type === "server"useDataTablebinds TanStack ↔ URL/local state- Toolbar switches simple ↔ advanced based on
filterFlag/ URL filters
See Architecture.