Filter Bar

A wrapping Tailwind toolbar for tables and lists: a search input first, your own filter controls as children, and a Clear button when onClear is set.

src/registry/ui/filter-bar.tsx/r/filter-bar.json

Installation#

bash
npx shadcn@latest add @minidev/filter-bar

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/filter-bar.json

Usage#

tsx
import { FilterBar } from "@/components/ui/filter-bar"

export function Example() {
  return (
    <FilterBar onClear={() => setFacets([])}>
      <ChipFilter value={chip} onChange={setChip} options={[{ value: "all", label: "All" }, { value: "mine", label: "Mine" }, { value: "open", label: "Open" }]} />
    </FilterBar>
  )
}

API reference#

FilterBar props
PropTypeDefault
childrenReact.ReactNode-
onClear() => void-
classNamestring-

Dependencies#

npm

React only

Examples#

All data table components

Learn more