Componentform1.06 KB gzipZero dependencies
Search Filter Bar
Combined search, sort and filter toolbar with animated chips.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add search-filter-barOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { SearchFilterBar } from "@/components/ui/search-filter-bar"; <SearchFilterBar />Source code
search-filter-bar.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxsearch-filter-bar.tsx111 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface SearchFilterBarProps extends React.HTMLAttributes<HTMLDivElement> { value?: string; defaultValue?: string; onValueChange?: (value: string) => void; placeholder?: string; sorts?: { id: string; label: string }[]; activeSort?: string; onSortChange?: (id: string) => void; filters?: { id: string; label: string; active?: boolean }[]; onFilterToggle?: (id: string) => void;} /** Search and filter toolbar: search input + sort dropdown + filters. */Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { SearchFilterBar } from "@/components/ui/search-filter-bar"; <SearchFilterBar />| Prop | Type | Description |
|---|---|---|
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. |
| onValueChange | (value: string) => void | Callback invoked on value change. |
| placeholder | string | Placeholder text shown when empty. (Default: "Search…") |
| sorts | { id: string; label: string }[] | Configures sorts. (Default: []) |
| activeSort | string | Configures active sort. |
| onSortChange | (id: string) => void | Callback invoked on sort change. |
| filters | { id: string; label: string; active?: boolean }[] | Configures filters. (Default: []) |
| onFilterToggle | (id: string) => void | Callback invoked on filter toggle. |