Skip to content

Filter Chips

A filter bar that only edits a value: a chip per field, a multi-select menu behind each, and nothing filtered for you. Keep the value in the URL, a store or on the server.

On this page
Used for
  • Issue and task lists
  • Filters kept in the URL
  • Filters saved on the server
  • Any list that is not a DataTable

Examples

Installation

npx knowns-ui@latest add filter-chips
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Collapsed

Props

fields
FilterField[]
{ id, label, icon?, options, multiple?, plural? }. Options are { value, label, icon?, avatar?, keywords? }; avatar is a photo URL or your own node.
value
Record<string, string[]>
Field id to the chosen option values. A field without values is not active. Unknown ids and values are ignored.
onChange
(next: FilterValue) => void
Called with the whole new value. Empty fields are removed from it.
collapsed
boolean | "auto"
Default"auto"
true folds the empty fields into one + Filter menu; false always shows a ghost chip per field. auto folds below 520px or with more than five empty fields.
searchFrom
number
Default8
A menu with more options than this gets a search box.
addLabel
string
Default"Filter"
The label of the + button when folded.
multiple (field)
boolean
Defaulttrue
false picks one value and closes the menu.
plural (field)
string
Default"selected"
What two or more values are called on the chip: "2 people".
Keyboard
-
Chips are in the tab order. Enter or Space opens a menu; arrows, Home, End, typeahead move; Space or Enter toggles; Esc closes. Backspace or Delete on a chip clears it.
Motion
-
A chip fades in over 120ms. Menus use the kit's fade. Nothing animates layout.

What it handles

  1. 01Edits one plain object, field id to the chosen values, and never touches your rows: filter on the client, in the URL or on the server.
  2. 02Shows an empty field as a ghost + chip and an active one as Field is Value with a clear button, in the same place, so nothing jumps.
  3. 03Opens a multi-select menu per field with search once there are more than eight options, avatars for people and arrows, Home, End and typeahead.
  4. 04Folds the ghosts into one + Filter menu when the bar is narrow or you ask for it, and shows Clear all from two active chips.
  5. 05Ignores values the options no longer know, so a stale link cannot show a chip you cannot clear.
  6. 06Keeps every chip in the tab order, clears one with Backspace or Delete, and names each chip in full for screen readers.

States

Chip appears
Fades in; the row does not move
120ms, ease-out
Menu opens
The kit's floating fade
180ms, ease-out
Row hover and focus
Background fades in
120ms, ease-out
Reduced motion
Nothing fades
0ms

Works with

When to use

When to use

  • Filters for a list of issues, tasks or records that live in the URL or on the server.
  • A filter bar next to a list you render and filter yourself.

When not to use

  • Filters tied to the rows of a table, with counts per value: use Data Table.
  • Picking one value for a form field: use Combobox.
  • Two or three always-on toggles: use Segmented Control.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Filter Chips to my app and wire it to my own data.
  • I need filters for a list of issues, tasks or records that live in the URL or on the server. Set that up with the Knowns UI Filter Chips.
  • Which Filter Chips props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "filter-chips" }) and search_docs({ query: "filter chips" }).

Need help?

Stuck on Filter Chips, or found something off? We read every message.