DocsSupportPricing
Roadmap (has updates coming soon)XFigma3.7K
Sign inGet All-Access
  1. Components
  2. Filters
DocsMarkdownPro 47 blocks

Shadcn Filters

Browse 12 production-ready shadcn filter components integrating TanStack Table column filters, Zod validation, nuqs URL state persistence, react-day-picker date ranges, and i18n support. Covers field type variety, custom triggers, data grid integration, async filter mode, and size variants.

For AI Agents

Hand your agent this brief or the ReUI MCP, not a screenshot. Free to install.

When to use

  • Toolbars of removable filter chips over a table or list, one field, condition and value per chip
  • Nested AND and OR condition builders, hung off a trigger over a report or laid out inline
  • Attribute catalogs too large or deep to list at once, and option lists paged from a server

When not to use

  • A finished record table with its chip bar, paging and row actions already built: use the Filtering blocks
  • Storefront product facets with price sliders, color swatches and department pills: use the Filter Sidebar blocks
  • One day or span of days picked on its own, with no attribute or condition: use the Date Selector component

Agent notes

  • renderValue, icon and a component editor count toward the schema index by presence only, so swapping one alone keeps serving the old one
  • A rule reaches onQueryChange unfinished: an empty operator, or a value still undefined or empty where its arity is not none; skip it when compiling
  • Negate swaps to an operator's inverse where one exists and otherwise sets negated, as on starts_with, so a compiler must read negated

Third-party API docs

  • date-fns v4: docs
  • TanStack Table v9: API reference, docs, used by 2 of 12 examples
  • React DayPicker v9: API reference, docs, used by 1 of 12 examples
  • input-otp v1: API reference, docs, used by 1 of 12 examples
Markdownhttps://web.dev.reui.io/components/filters.md
MCPget_component("filters")
Installnpx shadcn@latest add @reui/filters
Full index for agents:llms.txtReUI MCP setup

Shadcn Filters: Faceted Search with TanStack and nuqs

ReUI Filters is a custom shadcn component for building filter panels that connect directly to TanStack Table's column filter API. It renders a composable set of field types: text, select, multi-select, date range, number range, and boolean toggles: validates input with Zod, and persists active filters to the URL with nuqs for shareable, bookmarkable filtered views.

12 components cover field variety, input validation, custom trigger buttons, compact and large size variants, custom control rendering, full data grid integration, async filter mode for server-side filtering, and i18n support with locale-aware labels and date formatting.

The sections below explain the architecture, why URL-persistent filters matter, feature details, and how Filters integrates with Data Grid and other ReUI primitives.

What is Shadcn Filters?

ReUI Filters is a custom shadcn component that does not exist in the base shadcn/ui library. It generates a filter panel from a schema of field definitions: each field maps to a column in a TanStack Table instance or a standalone filter state. Field types include text search, single and multi-select dropdowns, calendar date ranges via react-day-picker, number ranges, and boolean toggles. Zod validates filter values before they reach the table or API.

Filter state can be controlled locally or serialized to URL search parameters using nuqs: the typed URL state library built for Next.js App Router. This means users can share filtered views, the browser back button restores filter state, and analytics tools capture filter combinations as URL parameters.

Why Use Shadcn Filters?

Every data-heavy interface needs filters: analytics dashboards, CRM contact lists, order management tables, log viewers, and product catalogs all benefit from a consistent, type-safe filter panel. Building filters ad-hoc per page leads to duplicated logic, inconsistent UX, and URL state management debt. ReUI Filters centralizes all of that in a composable schema-driven component.

The async mode component fires a debounced callback on filter change instead of updating a local table instance: enabling server-side filtering for large datasets where full client-side data is impractical. Pair with Shadcn Data Grid for the most complete data management interface in ReUI.

Libraries and ReUI Filters Primitives

ReUI Filters integrates @tanstack/react-table for column filter state, nuqs for URL search param serialization, Zod for filter value validation, date-fns for date formatting and localization, and react-day-picker for calendar date range inputs.

The filter panel composes shadcn Dropdown Menu, Popover, Calendar, Badge, Button, and ScrollArea. Badge renders applied filter chips; Popover contains the date range calendar; ScrollArea handles long option lists in multi-select fields.

Shadcn Filters Features

  • TanStack Table Column Filter API. Filters map directly to TanStack Table column definitions. Set column.getFilterValue() and column.setFilterValue() for client-side filtering, or use manualFiltering with an async callback for server-side filtering.
  • nuqs URL State Persistence. Active filter state serializes to URL search parameters via nuqs. Users can share filtered views, the browser back button restores filters, and Next.js App Router handles hydration without extra code.
  • Zod Filter Validation. Filter values pass through a Zod schema before reaching the table or API call. Invalid inputs are rejected before triggering a filter update, preventing malformed API requests.
  • Date Range Filters. Date range fields use react-day-picker inside a Popover for accessible calendar-based date selection. Integrates with date-fns for locale-aware formatting and range validation.
  • Multi-Field Type Support. Text search, single select, multi-select with checkboxes, date ranges, number ranges, and boolean toggles, all defined in a single field schema and rendered by the filter panel automatically.
  • Applied Filter Chips. Active filters render as shadcn Badge chips with remove actions. A clear-all button resets all filters and, if nuqs is active, clears the URL state.
  • Async and Server-Side Filter Mode. The async filter component debounces filter changes and fires a callback instead of updating local table state. Wire to SWR, React Query, or Next.js Server Actions for large datasets where client-side filtering is not feasible.
  • i18n Support. Field labels, placeholder text, and date formatting accept locale props. The i18n filter component shows English and localized variants side by side using date-fns locale utilities.
  • Size Variants and Custom Controls. Compact (small), default, and large size variants adapt to dense admin toolbars or spacious marketing dashboards. Custom control rendering allows any shadcn input component inside a filter field.

ReUI Filters: In-House Custom Shadcn Component

ReUI Filters is an in-house component built and maintained by the ReUI team as part of the ReUI open-source library. It is designed to integrate seamlessly into any shadcn/ui project: following the same copy-and-own installation model. The component source lands directly in your repository; you own it, extend it, and style it with your Tailwind CSS tokens. ReUI Filters is a custom schema-driven filter panel not available in base shadcn/ui. It integrates directly with @tanstack/react-table column filter APIs, persists filter state to URL search params via nuqs, validates inputs with zod, and supports async server-side filtering for large datasets. The i18n and custom control components extend it for global products.

The component is available in two API flavors to match your primitive stack: a Radix UI version for teams using Radix-based shadcn primitives, and a Base UI version for teams on @base-ui/react. Both versions share identical visual output and Tailwind CSS styling: only the underlying headless primitive differs. ReUI maintains 22 such in-house components, all available in both Radix and Base UI versions, each with dedicated documentation covering the full component API, usage examples, and prop references.

Integrating With Other Components

Filters is designed to pair with Shadcn Data Grid. Use Filters above the grid for a full data management interface with column filtering, sort, pagination, and CRUD: the data grid with filters components show this complete composition.

Use Shadcn Badge for applied filter chips, Shadcn Calendar inside Shadcn Popover for date range fields, and Shadcn Select or Shadcn Combobox for option-based fields that need search.

Wrap filter panels in Shadcn Sheet for a slide-out mobile filter drawer, or Shadcn Collapsible for an inline expandable filter section above a table. Use Shadcn Button for the custom trigger component.

Data Grid Blocks in ReUI Pro

The free data grid examples above cover focused, single purpose patterns. ReUI Pro extends them with 47 production ready data grid blocks, complete sections that compose the same primitives into full screens. Browse them by category:

  • Base (8 blocks)Complete table screens with toolbar filters and pagination for CRM, support, team, project, and pricing data.
  • Advanced (8 blocks)Analytics grids with in-cell charts, KPI rollups, a tree view and an SLO chart, plus a review queue, a stock mix sheet, a pro forma and a visit planner.
  • Columns (5 blocks)Column visibility, pinning, resizing, density, and settings controls.
  • Drag & Drop (4 blocks)Drag-and-drop row and column reordering with sortable handles.
  • Editing (6 blocks)Inline create, edit, and delete cells for full CRUD workflows.
  • Expansion (3 blocks)Expandable parent rows with nested sub-rows and master-detail panels.
  • Filtering (4 blocks)Search, faceted filters, filter builders, and status tab toolbars.
  • Grouping (7 blocks)Rows grouped into banded sections with stage and category headers.
  • Virtualization (2 blocks)Virtualized rendering for large datasets with smooth scrolling.

Browse all Data Grid blocks

Frequently Asked Questions

How do filters connect to TanStack Table?

Each filter field maps to a TanStack Table column via its accessorKey or id. The filter panel calls column.setFilterValue() on change and reads column.getFilterValue() to initialize state. Set filterFn on the column definition to control matching logic (exact, includes, inDateRange, etc.).

How does URL filter state work with nuqs?

Filter state is parsed from and written to URL search parameters via nuqs typed query hooks. In Next.js App Router, nuqs uses the router to update the URL without full navigation. Filters hydrate from the URL on mount, so shared links restore the exact filter state.

Can filters work with server-side data?

Yes. Enable manualFiltering: true on the TanStack Table instance and use the async filter component. The filter panel debounces input and fires a callback with the current filter values. Pass these to your API route, SWR key, or React Query queryFn to fetch filtered results from the server.

How are date range filters implemented?

Date range fields use react-day-picker in range mode inside a shadcn Popover. Selected dates are validated and formatted with date-fns. The range value passes to TanStack Table's inDateRange filter function or to your API as ISO date strings.

Can I add custom filter controls beyond the built-in types?

Yes. The custom controls component accepts any React node as a field renderer. Pass a shadcn Select, Combobox, Slider, or any other input component. The field wrapper handles the label, applied state, and clear action.

Does the filter panel support i18n?

Yes. Field labels and placeholder text are props. Date formatting uses date-fns locale objects. The i18n filter component shows how to pass a locale to react-day-picker and date-fns simultaneously for consistent date display.
Previous10 Shadcn File Upload Components
Next19 Shadcn Frame Components

Start building with ReUI Pro today.

Every Pro block, every style, and every future addition, with one license for unlimited projects.

Get All-Access

From $249, once. Lifetime updates.

Application

  • App Shell
  • Auth
  • Card
  • Dashboard
  • Dialog
  • Empty State
  • Event Calendar
  • Flow
  • Form
  • Gantt
  • Kanban Board
  • List
  • Navbar
  • Onboarding
  • Profile
  • Rich Text Editor
  • Schedule
  • Settings
  • Sheet
  • Stats2 meter cards moved here from Charts, 17 in all
  • Timeline
  • Whiteboard
  • Wizard

Data Grid

  • Base
  • AdvancedAdded 2 new Data Grid Advanced blocks, 5 in all
  • Columns
  • Drag & Drop
  • Editing
  • Expansion
  • Filtering
  • Grouping
  • Virtualization

Charts

  • Area ChartAdded a new Inbound Leads area chart block
  • Bar Chart
  • Composed Chart
  • Line Chart
  • Pie Chart
  • Radial Chart
  • Sankey ChartNew Sankey Chart category with 3 flow chart blocks
  • Slope ChartNew Slope Chart category with 2 rank-shift chart blocks
  • Sparkline
  • Status Tracker

AI & Agents

  • AI Chat
  • Agent Activity
  • AI UsageNew AI Usage category with 2 spend blocks

Solutions

  • Dev Ops
  • AI Ops
  • CRM
  • Agents
  • Analytics
  • Billing
  • Bookings
  • Files
  • Inventory
  • Users
  • Digital TwinNew Digital Twin category with 2 interactive 3D blocks

Templates

  • All templates

eCommerce

  • Category Card
  • Checkout
  • Comparison
  • Coupon
  • Filter Sidebar
  • Product Card
  • Product Detail
  • Product Grid
  • Receipt
  • Review
  • Shopping Cart
  • Wishlist
  • Shop Hero

Marketing

  • Blog
  • Compare
  • Contact
  • CTA
  • FAQ
  • Hero
  • How It Works
  • Pricing

Resources

  • Components
  • Blocks
  • Icons
  • MCP for Agents
  • Docs
  • Support
  • Pricing
  • Tailwind Plus Alternative
  • Roadmap(has updates coming soon)
  • AffiliateSoon

Legal

  • Privacy Policy
  • Terms & Conditions
  • License
  • Refunds
  • Cookies

© 2026 ReUI. All rights reserved.

3.7K

Multi-select, nested fields, async options and stacked values.

Drill-down groups, a filterable branch and deep search.

Colour-coded options and badges in the chip.

Avatar options, results paged over the wire and a saved view.

Consumer-owned date and date range controls.

One slider editor for range and single-value operators.

The query tree compiled to a row predicate.

Toggle group, radios, checkboxes, select and switch.

An input group, a term list, code slots and a validated domain.

A data grid paged, sorted and totalled under a popover builder.

The builder inline, beside its own tree read back as an expression.

One controlled query, three locales and every change reported.