Sortable data table
Compare structured records with sortable columns.
Keep collection filters close and easy to reset.
npx shadcn@latest add @silicon-ui/filter-toolbarnpx shadcn@latest add @silicon-ui/filter-toolbarInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/filter-toolbar/filter-toolbar.tsxcomponents/silicon-ui/filter-toolbar/filter-toolbar.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
FilterToolbar| Prop | Type | Default |
|---|---|---|
filters* | FilterChip[] | — |
onRemove* | (id: string) => void | — |
onClearAll | () => void | — |
children | ReactNode | — |
label | string | "Active filters" |
addFilterAdds an Add filter trigger that morphs into a two step field and value menu. | { fields: FilterField[]; onAdd: (filter: FilterChip, field: FilterField) => void; label?: string; align?: "start" | "end" } | — |
FilterMenu| Prop | Type | Default |
|---|---|---|
fields* | FilterField[] | — |
onSelect*Receives a chip whose id is the field id, so a second pick for a field replaces the first. | (filter: FilterChip, field: FilterField) => void | — |
activeApplied filters. Each field shows its current value and the value step marks it. | FilterChip[] | [] |
label | string | "Add filter" |
alignThe trigger edge the panel lines up with. It flips or shifts when the viewport, or a clipping ancestor, has no room. | "start" | "end" | "end" |