Skip to content
Kits

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 />
    </FilterBar.Root>

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 />
    </FilterBar.Root>

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 />
    </FilterBar.Root>

Custom chips

  • <FilterBar.Root>
    • <FilterBar.Chips>
      • renderChip(item)
        • <FilterBar.Chip />
      </FilterBar.Chips>
    • <FilterBar.AddButton />
    </FilterBar.Root>

Installation

Use this command to install the component.

Registry command
See registry manifest

Usage

Dependencies

Contextsrc/registry/sources/control-ui/filter-bar/context.tsxSupport
Editorsrc/registry/sources/control-ui/filter-bar/editor.tsxSupport
Modelsrc/registry/sources/control-ui/filter-bar/model.tsSupport
Motionsrc/registry/sources/control-ui/filter-bar/motion.tsSupport
Partssrc/registry/sources/control-ui/filter-bar/parts.tsxSupport
Typessrc/registry/sources/control-ui/filter-bar/types.tsSupport
Motionsrc/registry/lib/motion.tsUtil
ButtonbuttonPrimitiveComboboxcomboboxPrimitiveLive statuslive-statusPrimitiveTypographytypographyPrimitive

Raw code

Installed component source and support files

src/registry/sources/control-ui/filter-bar.tsx

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)