Filter Chips
Filters as chips in a FilterBar: one chip per active filter that opens an editor for its field, a button that removes it, Add filter for the others, and reset. Picks apply at once; typed values on Enter or when the editor closes.
Example
Remove Status filterRemove Points filter
Applied {"status":["open","blocked"],"points":{"op":"gte","value":3}}
filter-chips-demo.tsxCopy code
Installation
Copy code
Brings alongnarrowfilter-barpopoverdropdown-menufilter-fieldfilter-searchfilter-schemapage-sourcelocale
npm packages
lucide-reactUsage
ImportCopy code
Use chips when a few filters apply at a time and people should see them at a glance.
API reference
FilterChips
| Prop | Type | Default |
|---|---|---|
fieldsThe fields offered, in order. Default: every field but the search field, which `FilterSearch` edits. | readonly (keyof S & string)[] | – |
valueLabelsLabels of remote option values chosen elsewhere, like ids read from the URL. | Readonly<Record<string, string>> | – |
labels | Partial<FilterChipsLabels> | – |
localeWrites the chips' numbers and dates, and the editors'; the page's `<html lang>` by default (`useLocale`). | string | – |
schema | S | – |
controller | PageController<FilterValues<S>> | – |
className | string | – |
Other exports
filterChipsLabelssummarizeFiltertype FilterChipsLabelstype FilterChipsPropsAccessibility
- A UI SDK Toolbar: one tab stop, arrow keys between chips. Each chip's text is its name, and its remove button says which filter it removes.
- Removing a chip moves focus to Add filter instead of losing it.
Agent actions
Agents open a chip by its name and set the field inside; FilterScope's filter(field, value) does it in one step.
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.