v1.3.5
Filters

All filters

Every filter in one panel: a list with the values set on each, and the picked filter open beside it.

Live example

Filters

19 cars
Price and age
$15k to $45k
Model and body
ToyotaHonda
SUV
Engine

Body style

Pick one or more.

Direction
Locale
State

Copy

Claude Code
Cursor
v0
Lovable
Other
Add the "All filters" filter from FiltersUI to this project. It is free and MIT licensed, from filtersui.com.

If this project has a components.json, run: npx shadcn@latest add https://filtersui.com/r/all-filters.json
Otherwise read https://filtersui.com/r/all-filters.json: it holds the files with the path to save each one at, and lists any other FiltersUI items it needs.
How it works, its props and an example: https://filtersui.com/filters/all-filters

When done, run the app, tell me which page to open, and show me the value changing as I use the filter.

What it does

  • The picked row is tinted, and the filter on the right rises in from a blur.
  • Each row carries its values as chips; a new chip grows in, and a removed one collapses while the rest close up.
  • The find box narrows the list by name or other words ("mileage" finds Kilometres) and marks the letters it matched.
  • Below 520px wide the list and the filter take turns: a row slides its filter in, Back slides the list back.

Keyboard

  • Tab runs the head, the find box, the list (one stop) and then the picked filter.
  • In the list, Up and Down move between rows, Home and End jump, Enter or Space picks; Down in the find box enters the list, Enter picks the first match.
  • On a narrow panel, picking moves focus to Back, and Back or Escape returns to the row.
  • Clear moves focus to the filter's first control; Clear search moves it to the find box.
  • While disabled Tab reaches only Show; in an error Tab reaches Retry after the list.

Props

Value. None of its own: each entry shows a filter you keep in your own state. picked is the id of the filter open on the right.

AllFilters props
PropDescription
groups
Required

The list, in groups such as "Price and age".

readonly { label: string; filters: FilterEntry[] }[]
FilterEntry
Required

One filter in a group: its name, a short line under its title, more words for the find box, its set values, Clear, and the filter itself.

{ id, label, hint?, keywords?, values?, onClear?, content }
FilterEntry.values
Optional

What is set, one chip each in the list with its own cross. Empty means unset. color draws a small swatch.

readonly { key: string; label: string; onRemove: () => void; color?: string }[]
picked / defaultPicked / onPickedChange
Default none picked

The filter open on the right, controlled or not.

string | null / string | null / (id: string | null) => void
onClearAll
Optional

Clears every filter, from the "3 set" chip in the head.

() => void
showLabel / onShow
Default "Done"

The head's button, e.g. "Show 34 cars".

string / () => void
title / headingLevel
Default "Filters" / 2

The head's title; the picked filter's title sits one level below.

string / 2 | 3
findLabel / height
Default "Find a filter" / 560

The find box's words, and the height of the two columns in px from 520px wide.

string / number
locale
Default "en-US"

Formats the "3 set" count, e.g. "ar-EG". Words stay English.

string
status
Default "ready"

"loading" draws placeholders the size of the real content, so nothing moves when the data arrives; "error" shows errorText and a Retry button in its place.

"ready" | "loading" | "error"
onRetry
Optional

Called by Retry in the error state. Without it the error line has no button.

() => void
errorText
Default "Couldn't load the options."

The error line, in plain words.

string
disabled
Default false

Dims the list and the picked filter and blocks their input; Show stays, and the "3 set" chip, Clear and the chips' crosses are left out.

boolean

More filters