FilterBar
Build editable field, operator, and value filters with a button or inline search.
Examples
Inline search
Type to build filters directly in the bar. Both entry points use the same editor.
Remote value search
The host supplies matching values, loading and error states, and keeps selected labels available.
Composition
Button entry
The app supplies fields, operators, and controlled filters, and owns evaluation and persistence. Only complete filters reach onValueChange. Operator arity is one by default; many commits an array and none commits null.
- <FilterBar.Root>
- <FilterBar.Chips />
- <FilterBar.AddButton />
- <FilterBar.Clear />
Inline entry
Input and AddButton can coexist. Escape goes back through the editor and then cancels without changing committed filters. Multiple selections finish with Done or Ctrl/⌘+Enter.
- <FilterBar.Root>
- <FilterBar.Chips />
- <FilterBar.Input />
- <FilterBar.Clear />
Remote values
Fields with optionsMode=remote notify onQueryChange with fieldId, operatorId, and query. Supply options, loading, error, and formatValue for persistent labels. The host owns fetching, cancellation, and stale responses.
- <FilterBar.Root>
- <FilterBar.Chips />
- <FilterBar.AddButton />
- <FilterBar.Clear />
Custom chips
- <FilterBar.Root>
- <FilterBar.Chips>
- renderChip(item)
- <FilterBar.Chip />
- renderChip(item)
- <FilterBar.AddButton />
- <FilterBar.Chips>
Installation
Use this command to install the component.
Usage
Dependencies
src/registry/sources/control-ui/filter-bar/context.tsxSupportsrc/registry/sources/control-ui/filter-bar/editor.tsxSupportsrc/registry/sources/control-ui/filter-bar/model.tsSupportsrc/registry/sources/control-ui/filter-bar/motion.tsSupportsrc/registry/sources/control-ui/filter-bar/parts.tsxSupportsrc/registry/sources/control-ui/filter-bar/types.tsSupportsrc/registry/lib/motion.tsUtilbuttonPrimitiveComboboxcomboboxPrimitiveLive statuslive-statusPrimitiveTypographytypographyPrimitiveRaw code
Installed component source and support files
Knobs
Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.
--cui-filter-bar-* · 10 knobsHow the cascade resolves--cui-filter-bar-background<color>var(--control-fill)--cui-filter-bar-foreground<color>var(--foreground)--cui-filter-bar-border-color<color>var(--control-rim)--cui-filter-bar-border-width<length>var(--control-rim-width)--cui-filter-bar-radius<length-percentage>var(--radius-control)--cui-filter-bar-height<length-percentage>var(--control-h-sm)--cui-filter-bar-gap<length-percentage>calc(var(--spacing) * 1.5)--cui-filter-bar-padding-inline<length-percentage>calc(var(--spacing) * 2)--cui-filter-bar-font-size<length-percentage>var(--text-label)--cui-filter-bar-hover-background<color>var(--hover-fill)