Content
- One or two words, sentence case. Counts are numbers only: "All 8", not "All (8 items)".
A filter pill people switch on and off, with an optional count.
import { … } from "@brdgapp/ui/components/filter-chip"FilterChip is a bordered pill people turn on and off to narrow what they see: All / To do / Updates on Activity, or sources in a drawer. It can show a count. The usual mistake is using it as a label: a chip you can't press is a Tag.
Labels are boxes, controls are pills
Tags and badges have 4px corners and never become pills. Pills (rounded-full) are for things you press: buttons, filter chips, search fields, segmented controls.
Counts match what's shown
A number on screen comes from the same filtered list that renders the items, never from a separate count that can disagree. Never show a silent 0 when a count failed to load.
Pill. 1px border, 13px SemiBold label.
Count. Optional, after the label, muted, with even-width digits.
Activity's All / To do / Updates.
Source filters that combine.
| Rest | Hover | Focus | Disabled | |
|---|---|---|---|---|
| Off | ||||
| On |
| State | What happens |
|---|---|
| Off | Clear fill, --text-disabled border. |
| On | --surface-tertiary fill, darker border, --text-primary label. |
| Hover | Border and label darken. |
| Focus visible | 2px blue ring. |
| Disabled | 30% opacity and no pointer events. |
aria-pressed, so screen readers say on or off.active and handle onClick.Do
Wrap a row of chips in a group with anaria-label ("Show", "Sources").Don't
Leave a row of chips with no name for what they filter.| Keys | Action |
|---|---|
| EnterSpace | Turn the chip on or off. |
FilterChip
The filter pill, built on Base UI Toggle. Extends Base UI Toggle.
| Prop | Type | Default | Description |
|---|---|---|---|
active | boolean | false | Whether the filter is on. |
count | number | — | Shown after the label. |
onClick | () => void | — | Handle the press. |
className | string | — | Layout only. |
What it's built from and where it's used, read from the code. When you change it, check these too.
components.md → FilterChip; src/components/ui/filter-chip.tsx.