Legacy compatibility
Maintaining an older TanStack Table v8 or useLegacyTable integration that still expects the legacy row-model option.
TanStack · Function
getFacetedRowModel is a deprecated legacy compatibility marker for TanStack Table v8 faceting. For current tables, register createFacetedRowModel() in the facetedRowModel feature slot instead.
In current TanStack Table, the legacy getFacetedRowModel function is only a compatibility marker for the older useLegacyTable API. New tables register createFacetedRowModel() in the facetedRowModel feature slot, after which a column can expose getFacetedRowModel() for facet calculations.
function getFacetedRowModel<TData>(): FacetedRowModelFactory<TData>;| Name | Type | Description |
|---|---|---|
TData | RowData | Generic row-data type extending RowData; the legacy function takes no runtime arguments. |
FacetedRowModelFactory<TData>
import { createFacetedRowModel } from '@tanstack/table-core'
const tableFeatures = {
facetedRowModel: createFacetedRowModel(),
}
const facetedRows = table.getColumn('status')?.getFacetedRowModel()
console.log(facetedRows?.rows)Registers the client-side factory, then retrieves the rows eligible for faceting on a column.
Maintaining an older TanStack Table v8 or useLegacyTable integration that still expects the legacy row-model option.
Building client-side faceted filters in the current table API by registering createFacetedRowModel() and reading a column's faceted model.
Implementing custom facet calculations from rows that satisfy other active filters.
The legacy function returns a FacetedRowModelFactory<TData> and acts as a marker that enables the faceted row model. In the current API, new tables should register createFacetedRowModel() through the facetedRowModel feature slot.
Follow-up: What happens without filteredRowModel? The faceted model uses pre-filtered rows, so values do not reflect filters applied to other columns.
A column's faceted row model contains rows that pass the other applicable filters while excluding that column's own filter. This supports facet choices that remain useful while the current column filter is being edited.
Follow-up: Which additional factories support common facet outputs? createFacetedUniqueValues() provides unique values and counts, while createFacetedMinMaxValues() supports numeric bounds.
The current feature slot is facetedRowModel, whose factory receives the table and column ID and returns a function producing a RowModel. Server-side faceting does not require this factory.
Follow-up: How would you replace the default behavior? Implement a custom factory with the same table-and-column contract and register it in tableFeatures.
createFacetedRowModel()column.getFacetedRowModel()createFacetedUniqueValues()createFacetedMinMaxValues()filteredRowModel