Filter bar
Narrows a list by several fields at once, each a pill that opens its options and names what it holds, so a person sees which filters are on without opening any.
Examples
3 funds
- Harbour Large Cap CoreHedge fund
- Calder Global EquityHedge fund
- Northgate Short DurationPrivate credit
- Pryor Dean Real AssetsReal estate
- Ashby Wren GrowthPrivate equity
- Hollis Crane IncomePrivate credit
- Marlow Kent OpportunitiesHedge fund
BK-48204 | Hanna Lindqvist | Harbour suite | $441.00 |
BK-48208 | Lukas Brandt | Harbour suite | $229.00 |
BK-48212 | Tomás Ibarra | Harbour suite | $617.00 |
BK-48216 | Amara Okafor | Harbour suite | $405.00 |
Usage
Use it when
- A list of records a person narrows by several fields at once: funds by type and domicile, bookings by room and status.
- A field with a known set of values, a few or a few hundred, where a count per value helps choose.
Use something else when
- One filter of two to six choices that are always in view, such as Upcoming and Past. Use SegmentedControl instead.
- A free search over names. Use Input instead, with
type="search", beside the bar. - Values from a server too many to list, such as every adviser. Use Combobox instead, which searches as you type.
- A filter of one on and off choice, such as Late filings. Use Pill instead.
Rules
General
Content
Avoid
Limits
Install
npx shadcn@latest add https://kaanarici.com/r/cobalt/filter-bar.jsonimport { FilterBar, FilterPill, FilterList, filterSummary, filterCount, filterLabels, slashFocusesSearch, type Filter, type ListFilter, type RangeFilterItem, type FilterSearch, type FilterOption } from "@/components/cobalt/ui/filter-bar"Related
- DataTablethe list the bar narrows; its column
filtertakesFilterList. - Sheetthe panel that holds every filter on a phone.
- ResultCounthow many results a query found: exact, about, at least, or capped with a way past the cap.
- Slidera value or a range picked along a track, with its bounds typed if needed.
