Build faceted filter UIs with columnFacetingFeature, facetedRowModel, facetedUniqueValues, and facetedMinMaxValues. Load for facet counts, numeric ranges, own-filter exclusion, or server-page facet completeness.
66
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
This skill builds on core, table-features, and column-filtering. Faceting derives filter choices; it does not render controls.
import {
columnFacetingFeature,
columnFilteringFeature,
createFacetedMinMaxValues,
createFacetedRowModel,
createFacetedUniqueValues,
createFilteredRowModel,
filterFn_includesString,
filterFn_inNumberRange,
tableFeatures,
} from '@tanstack/table-core'
export const features = tableFeatures({
columnFilteringFeature,
filteredRowModel: createFilteredRowModel(),
filterFns: {
includesString: filterFn_includesString,
inNumberRange: filterFn_inNumberRange,
},
columnFacetingFeature,
facetedRowModel: createFacetedRowModel(),
facetedUniqueValues: createFacetedUniqueValues(),
facetedMinMaxValues: createFacetedMinMaxValues(),
})const counts = table.getColumn('status')?.getFacetedUniqueValues() ?? new Map()
const range = table.getColumn('age')?.getFacetedMinMaxValues()Use unique values for discrete controls and min/max only for numeric ranges.
The filtered model makes facets respond to the table's other active filters.
Register individually imported built-ins under their conventional keys so
columns can reference them by string name; a column may instead receive a
filter function directly without registering it. The full filterFns registry
object still works but bundles every built-in.
Wrong: tableFeatures({ columnFilteringFeature, columnFacetingFeature })
Correct: tableFeatures({ columnFilteringFeature, columnFacetingFeature, facetedRowModel: createFacetedRowModel(), facetedUniqueValues: createFacetedUniqueValues() })
Each faceting getter needs its matching factory slot.
Source: packages/table-core/src/features/column-faceting/columnFacetingFeature.ts
Wrong: column.getFacetedUniqueValues().get(activeValue) === 0
Correct: column.getFacetedUniqueValues().get(activeValue) ?? 0
A column facet intentionally excludes that column's own filter while applying other filters.
Source: docs/framework/react/guide/column-faceting.md
Wrong: const globalCounts = column.getFacetedUniqueValues()
Correct: const globalCounts = await fetchFacetCounts(activeFilters)
With server pagination, client faceting sees only loaded data.
Source: docs/framework/react/guide/column-faceting.md#custom-server-side-faceting
Inspect node_modules/@tanstack/table-core/dist/features/column-faceting/ for exact getters and factory return types.
9e523bc
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.