Table Docs
API Reference
Table API Reference
Column API Reference
Row API Reference
Cell API Reference
Header API Reference
Features API Reference
- stockFeatures
- coreFeatures
- coreCellsFeature
- coreColumnsFeature
- coreHeadersFeature
- coreRowModelsFeature
- coreRowsFeature
- coreTablesFeature
- cellSpanningFeature
- columnFilteringFeature
- columnFacetingFeature
- rowAggregationFeature
- columnGroupingFeature
- columnOrderingFeature
- columnPinningFeature
- columnResizingFeature
- columnSizingFeature
- columnVisibilityFeature
- globalFilteringFeature
- rowExpandingFeature
- rowPaginationFeature
- rowPinningFeature
- rowSelectionFeature
- rowSortingFeature
- filterFns
- sortFns
- aggregationFns
- ColumnFilter
- ColumnPinningState
- ColumnSort
- PaginationState
- RowPinningState
- columnResizingState
- FilterFn
- FilterFns
- FilterMeta
- SortFn
- SortFns
- AggregationFns
- AggregationContext
- AggregationMergeContext
- AggregationFnDef
- AggregationFnDescriptor
- AggregationValueContext
- AggregationValueResult
- constructAggregationFn
- ColumnFiltersState
- ColumnOrderState
- ColumnPinningPosition
- ColumnResizeDirection
- ColumnResizeMode
- ColumnSizingState
- ColumnVisibilityState
- ExpandedState
- GroupingState
- RowPinningPosition
- RowSelectionState
- SortDirection
- SortingState
- AggregationFnOption
- AggregationResult
- FilterFnOption
- SortFnOption
- BuiltInAggregationFn
- BuiltInFilterFn
- BuiltInSortFn
Static Functions API Reference
Legacy API Reference
- Legacy API Overview
- useLegacyTable
- legacyCreateColumnHelper
- getCoreRowModel
- getFilteredRowModel
- getSortedRowModel
- getGroupedRowModel
- getExpandedRowModel
- getPaginationRowModel
- getFacetedRowModel
- getFacetedMinMaxValues
- getFacetedUniqueValues
- LegacyRowModelOptions
- LegacyTable
- LegacyTableOptions
- LegacyReactTable
- LegacyColumnDef
AI/LLM: This documentation page is available in plain markdown format at/table/latest/docs/reference/index/functions/tableFeatures.md
Table API Reference
tableFeatures
ts
function tableFeatures<TFeatures>(features): TFeatures;Defined in: helpers/tableFeatures.ts:46
A helper function to help define the features that are to be imported and applied to a table instance. Use this utility to make it easier to have the correct type inference for the features that are being imported. Note: It is recommended to use this utility statically outside of a component.
Alongside feature modules, this object carries everything else that is statically stitched into the table:
- Row model factories (sortedRowModel, filteredRowModel, etc.)
- Row model function registries (sortFns, filterFns, aggregationFns), whose keys become the valid string values for sortFn, filterFn, globalFilterFn, and aggregationFn with full inference
- Type-only tableMeta/columnMeta slots for declaring per-table meta types instead of using global declaration merging. The values are phantom (ignored and stripped at runtime); only their types are used.
Type Parameters#
TFeatures#
TFeatures extends TableFeatures
Parameters#
features#
TFeatures & ValidateFeatureSlots<TFeatures>
Returns#
TFeatures
Example#
plaintext
import {
columnFilteringFeature,
createFilteredRowModel,
createSortedRowModel,
filterFn_includesString,
rowSortingFeature,
sortFn_alphanumeric,
sortFn_text,
tableFeatures,
} from '@tanstack/react-table'
const features = tableFeatures({
columnFilteringFeature,
rowSortingFeature,
filteredRowModel: createFilteredRowModel(),
sortedRowModel: createSortedRowModel(),
filterFns: { includesString: filterFn_includesString, myCustomFilterFn },
sortFns: { alphanumeric: sortFn_alphanumeric, text: sortFn_text },
tableMeta: {} as { updateData: (rowIndex: number, columnId: string, value: unknown) => void },
columnMeta: {} as { align?: 'left' | 'right' },
});
const table = useTable({ features, columns, data });