filtering

Implement client-side column and global filtering in TanStack Table v9.

28.3k|3.6k|Updated Oct 20, 2016
One-click install
npx skills add https://github.com/TanStack/table --skill filtering-tanstack
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: filtering
Source: https://github.com/TanStack/table/tree/main/packages/table-core/skills/filtering
Command: npx skills add https://github.com/TanStack/table --skill filtering-tanstack

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you implement reliable row filtering in TanStack Table v9 so users can narrow large datasets using column filters, a global search box, faceted filter UIs, and optional fuzzy matching.

Core Features & Use Cases

  • Column filtering pipeline: Use columnFilteringFeature with filteredRowModel (via createFilteredRowModel(filterFns)) to filter by per-column criteria stored in state.columnFilters.
  • Global filtering pipeline: Use globalFilteringFeature to filter across eligible columns using state.globalFilter and a configurable globalFilterFn (built-ins like includesString or custom ones).
  • Faceted filtering: Use columnFacetingFeature with createFacetedRowModel() plus createFacetedUniqueValues() and createFacetedMinMaxValues() to power “autocomplete” and range-style filter controls that reflect counts/min-max after current filtering.
  • Fuzzy filtering: Add a custom FilterFn backed by @tanstack/match-sorter-utils (with module augmentation for FilterFns and optional FilterMeta) to support typo-tolerant matching.

Quick Start

Set up filteredRowModel: createFilteredRowModel(filterFns) with columnFilteringFeature and globalFilteringFeature, then drive filtering through table.setColumnFilters([{ id, value }]) and table.setGlobalFilter(value) while choosing an appropriate globalFilterFn (such as includesString).

Frequently Asked Questions about filtering

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement column filtering in TanStack Table v9?

Column filtering in TanStack Table v9 uses the columnFilteringFeature with a filteredRowModel, driven by state.columnFilters to narrow rows by per-column criteria. You configure createFilteredRowModel(filterFns) and update filters via table.setColumnFilters([{ id, value }]).

How does global filtering work in TanStack Table?

Global filtering uses globalFilteringFeature to filter across eligible columns via state.globalFilter. You configure a globalFilterFn, such as includesString, and update the search value through table.setGlobalFilter(value) to narrow rows globally.

Can I add typo-tolerant fuzzy search to TanStack Table?

Yes, fuzzy filtering is supported by adding a custom FilterFn backed by @tanstack/match-sorter-utils. This requires module augmentation for FilterFns and optional FilterMeta to register the typo-tolerant matching function in the filterFns registry.

How do I build faceted filter UIs with min-max and unique values in TanStack Table?

Faceted filtering uses columnFacetingFeature with createFacetedRowModel(), combined with createFacetedUniqueValues() and createFacetedMinMaxValues(). This provides counts and min-max metadata after current filtering to power autocomplete and range-style controls.

Does TanStack Table require module augmentation for custom filter functions?

Yes, custom filter functions require safe module augmentation for FilterFns and optional FilterMeta. This integrates custom logic into the filterFns registry, ensuring type safety and correct execution within the filtered-row pipeline stages.

What is the difference between column filters and global filter state in TanStack Table?

Column filters use state.columnFilters to apply specific criteria to individual columns, while global filter uses state.globalFilter to search across all eligible columns simultaneously. Both operate within the filtered-row pipeline but target different filtering scopes.