Filter Toolbar
The controls above a list or DataGrid, composed from parts that are each controlled (value/onChange), so every filter maps to a search param.
Overview
- `FilterToolbar`: lays the parts out, wrapping on narrow screens; its
i18n.labelsreaches every part. - `FilterSearch`: a react-aria
SearchFieldthat commits the term on Enter and when cleared — and, withdebounceMs, after the user stops typing. - `FilterQuickToggles`: an outlined
ToggleGroupfor one-press filters. - `FilterToolbarActions`: holds the trailing actions,
FilterSheetandFilterRefresh. - `FilterSheet`: a "Filters" button with the active count, opening a side
Sheet. Its children are theFields of a draft the app keeps:onApplycommits it (returnfalseto stay open),onClearempties it, and Enter applies. - `FilterRefresh`: spins while
isPending. - `FilterChips`: the applied filters as a react-aria
TagGroup, each removable with its × or Backspace/Delete, plus "Clear filters". Renders nothing when empty.
Installation
CLI
Manual
- 1
Register the @fma-ds namespace in components.json (once)
- 2
Add the item
Files land in
components/fma-ds/filter-toolbar/filter-toolbar.tsx; npm and registry dependencies are installed along with them.
Dependencies
- npm
- cn@^0.5.0lucide-react@^1.61.0react-aria-components@^1.22.1