Chip button
In code: ChipButton
A chip that is a button: a filter that is on (pressed) or off. onPressedChange runs when it is pressed.
Preview
Use
import { ChipButton, Row } from '@/components/ui';
function ChipButtonDemo() {
const [shown, setShown] = useState<string[]>(['Haircut']);
const flip = (name: string) => setShown(shown.includes(name) ? shown.filter((s) => s !== name) : [...shown, name]);
return (
<Row gap={2}>
{[['Haircut', 210], ['Colour', 300], ['Beard trim', 30], ['Styling', 150]].map(([name, tone]) => (
<ChipButton key={name} tone={Number(tone)} pressed={shown.includes(String(name))} onPressedChange={() => flip(String(name))}>
{name}
</ChipButton>
))}
</Row>
);
}Options
| Option | Type | What it does |
|---|---|---|
className | string | More classes on the outer element, for layout around it (margins, grid placement), not to restyle it. |
size | "sm" | "md" · default 'md' | Its size, one step from the theme's Size: sm, md (default) or lg. |
style | CSSProperties | Inline styles on the outer element; for CSS variables such as a height, not for colours. |
tone | number | A hue (0–360) that gives the chip its own colour. Left out, the chip is plain. |
It also takes the 291 attributes of the element or UI SDK part it draws: className, aria-label, events and the rest.
Without React
The same look on any HTML, with the classes button.ui-chip + aria-pressed.
With the CSS in parts (/ui/css/), it needs these, besides the ones every page loads:
components/chips.cssIn the examples
Small screens made with it and the rest of the kit. They work: click, type and choose in them.
November 2026
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 26 | 27 | 28 | 29 | 30 | 31 | 1 |
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 1 | 2 | 3 | 4 | 5 | 6 |
Actions and forms: states, do and don’t
A filter that is on or off; a row of them filters a list.
States. Every control has rest, hover, pressed, focus (a ring, from the keyboard only), disabled and, where it applies, chosen (data-checked, aria-pressed) and invalid (aria-invalid, with the message under the field). Each change of look fades with --ui-dur-fast.
Do
- Give every field a visible label (
Field label=…); a placeholder is an example, never the label. - Keep one primary button per view; deleting is
dangerand asks first withAlertDialog. - Say what went wrong under the field, in words a person can act on ("Enter a full email address").
- Use
NumberInput,DatePicker,Selectand the rest rather than a bare<input>: they bring the keyboard, the screen-reader names and the phone layout.
Don't
- Don't disable a button to say a form is incomplete without saying why next to it.
- Don't put two primary buttons side by side, or a primary button inside a menu.
- Don't use a
Switchfor something that only happens when a form is sent: that is aCheckbox.