Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

TanStack · Function

getFacetedRowModel

getFacetedRowModel is a deprecated legacy compatibility marker for TanStack Table v8 faceting. For current tables, register createFacetedRowModel() in the facetedRowModel feature slot instead.

How it works

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.

Syntax

function getFacetedRowModel<TData>(): FacetedRowModelFactory<TData>;

Parameters

NameTypeDescription
TDataRowDataGeneric row-data type extending RowData; the legacy function takes no runtime arguments.

Returns

FacetedRowModelFactory<TData>

Key points

  • The legacy function enables faceting rather than directly calculating a row collection.
  • The resulting model supplies rows used by custom facet calculations.
  • Current tables must provide the facetedRowModel feature factory for client-side faceting.

Common mistakes

  • The documented function is deprecated for new code; use createFacetedRowModel() with the current table setup.
  • It does not compute rows itself; it exists to preserve compatibility with the legacy v8 API.

Example: Use the faceted row model

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.

When to use it

Legacy compatibility

Maintaining an older TanStack Table v8 or useLegacyTable integration that still expects the legacy row-model option.

Client-side column faceting

Building client-side faceted filters in the current table API by registering createFacetedRowModel() and reading a column's faceted model.

Custom facet computation

Implementing custom facet calculations from rows that satisfy other active filters.

Interview questions

QWhat does getFacetedRowModel do?

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.

QHow does column faceting respond to filters?

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.

QHow is the current faceted row-model factory registered?

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

Source: getFacetedRowModel | TanStack Table React Docs. Checked 2026-10-15.