Skip to content
Eskais UI

Server data

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

Applied {"status":["open","blocked"],"points":{"op":"gte","value":3}}

Installation

npx shadcn@latest add @eskais/filter-chips

Usage

Import
import { FilterChips, filterChipsLabels, summarizeFilter } from "@/components/ui/filter-chips"

Use chips when a few filters apply at a time and people should see them at a glance.

API reference

FilterChips

PropTypeDefault
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>>–
labelsPartial<FilterChipsLabels>–
localeWrites the chips' numbers and dates, and the editors'; the page's `<html lang>` by default (`useLocale`).string–
schemaS–
controllerPageController<FilterValues<S>>–
classNamestring–

Other exports

filterChipsLabelssummarizeFiltertype FilterChipsLabelstype FilterChipsProps

Accessibility

  • 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.