Powerful and customizable React filter bar components built for modern applications and websites. These filter bars are built using React Aria and styled with Tailwind CSS.
Installation
You can add this filter bar component using our CLI or manually:
npx untitledui@latest add filter-bar
Filter bar examples
Below are examples and variations of this filter bar component:
Tabs and search
Our filter bar component works seamlessly with tab navigation. This variant combines tabs for quick category switching with a search input for filtering within each category.
Date filters
The date filters variant provides multiple ways to select time ranges, including quick-select buttons for common periods, a dropdown for additional options, and a date range picker for custom selections.
Advanced filter inactive
The advanced filter variant provides a query builder-style interface with field, operator, and value inputs. This allows users to create complex filter combinations for data-heavy applications.
Advanced filter active
This example shows the advanced filter with multiple active filter rows. Each row can be individually configured with a field, operator, and value, and removed with the close button.
Filter dropdown menus
Filter slideout menus
API reference
Import the parts and assemble them:
import { FilterBar } from "@/components/application/filter-bar/filter-bar"; <FilterBar.Root> <FilterBar.Content> <FilterBar.FilterRow /> </FilterBar.Content> <FilterBar.Actions> <FilterBar.FilterIconButton /> </FilterBar.Actions> </FilterBar.Root>
CountBadge
Import CountBadge from @/components/application/filter-bar/filter-dropdown-menu. Renders a <span> element.
FilterBar.Actions
Renders a <div> element.
Also accepts all standard HTML attributes, all aria-* attributes, all standard React DOM event handlers.
FilterBar.Content
Renders a <div> element.
Also accepts all standard HTML attributes, all aria-* attributes, all standard React DOM event handlers.
FilterBar.FilterRow
Renders a <div> element.
Also accepts all standard HTML attributes, all aria-* attributes, all standard React DOM event handlers.
FilterBar.Root
Renders a <div> element.
Also accepts all standard HTML attributes, all aria-* attributes, all standard React DOM event handlers.
FilterDialog
Import FilterDialog from @/components/application/filter-bar/filter-dropdown-menu. Renders React Aria’s Dialog — all of its props are supported.
FilterDropdown
Import FilterDropdown from @/components/application/filter-bar/filter-dropdown-menu. Renders React Aria’s DialogTrigger — all of its props are supported.
FAQs
Please refer to our frequently asked questions page for more.
The folder has two files. filter-bar.tsx exports the FilterBar layout parts: FilterBar.Root, FilterBar.Content, FilterBar.Actions, FilterBar.FilterRow and FilterBar.FilterIconButton. filter-dropdown-menu.tsx exports FilterDropdown, FilterDialog and CountBadge for the advanced filter popover. The examples on this page build their layouts from Tabs, Input, Select, DateRangePicker and FilterDropdown.
FilterBar.Root is a wrapping flex row. Put tabs, search and selects in FilterBar.Content, which grows to fill the space and wraps its children, and put buttons in FilterBar.Actions, which stays at its content width. FilterBar.FilterRow wraps one row of filter inputs with a remove button that calls onRemove. These parts only handle layout and hold no filter state.
Use FilterDropdown. Keep an array of { id, field, operator, value } rows in your own state, pass it as filters, and render each row's inputs with renderFilterRow(filter, onChange), calling onChange with the changed fields. Wire up onAddFilter, onRemoveFilter, onFilterChange and onClearAll; Apply filter calls onApply with the current rows and closes the popover.
Pass appliedCount to FilterDropdown and the default Filters button shows it in a badge. To use your own trigger, pass it as children; appliedCount and isDisabled then have no effect. The popover opens at "bottom end" by default, and placement also accepts "bottom" and "bottom start".
Use FilterBar.FilterIconButton with an icon component and always pass label. The button has no visible text, so label is its only accessible name. Handle clicks with onPress.
The examples use Input with icon={SearchLg}, size="sm", aria-label="Search" and placeholder="Search". The shortcut prop on Input only displays a ⌘K hint (hidden below md) and doesn't register a keyboard shortcut, so add your own handler if you need one.
The examples hide or swap controls with Tailwind breakpoint classes: the DateRangePicker gets max-md:hidden, an icon-only Filters button replaces the labeled one below md, and the period buttons switch to short labels such as 7d. Use the same approach for your own controls.