DataTable
DataTable
A data table which includes sorting, filtering, pagination, bulk actions, column controls etc.
This is the building block of all data tables in the Dashboard.
Parameters
props
parameter
Readonly<DataTableProps<TData>>DataTableProps
Props for configuring the DataTable.
children
property
React.ReactNodecolumns
property
ColumnDef<TData, any>[]data
property
TData[]totalItems
property
numberisLoading
property
booleanpage
property
numberitemsPerPage
property
numbersorting
property
SortingStatecolumnFilters
property
ColumnFiltersStateonPageChange
property
(table: TableType<TData>, page: number, itemsPerPage: number) => voidonSortChange
property
(table: TableType<TData>, sorting: SortingState) => voidonFilterChange
property
(table: TableType<TData>, columnFilters: ColumnFilter[]) => voidonColumnVisibilityChange
property
(table: TableType<TData>, columnVisibility: VisibilityState) => voidonSearchTermChange
property
(searchTerm: string) => voiddefaultColumnVisibility
property
VisibilityStatefacetedFilters
property
{ [key: string]: FacetedFilter | undefined }disableViewOptions
property
booleanbulkActions
property
BulkActionsInputsetTableOptions
property
(table: TableOptions<TData>) => TableOptions<TData>This property allows full control over all features of TanStack Table when needed.
onRefresh
property
() => voidonReorder
property
(oldIndex: number, newIndex: number, item: TData, allItems?: TData[]) => void | Promise<void>Callback when items are reordered via drag and drop. When provided, enables drag-and-drop functionality. The fourth parameter provides all items for context-aware reordering.
disableDragAndDrop
property
booleanWhen true, drag and drop will be disabled. This will only have an effect if the onReorder prop is also set
Was this chapter helpful?