Skip to the page
Supply UI

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

The code of the preview above
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>
  );
}

This page as text, for an AI

Options

OptionTypeWhat it does
className stringMore 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 CSSPropertiesInline styles on the outer element; for CSS variables such as a height, not for colours.
tone numberA 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.css

In the examples

Small screens made with it and the rest of the kit. They work: click, type and choose in them.

October€2,400.00Spent, all of it
Where the month went Pick a category to see its share

November 2026

MonTueWedThuFriSatSun
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456
Check-up for BiscuitMornings, 30 minutes
A free morning for Biscuit Days with room are marked. The times follow the day.

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 danger and asks first with AlertDialog.
  • Say what went wrong under the field, in words a person can act on ("Enter a full email address").
  • Use NumberInput, DatePicker, Select and 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 Switch for something that only happens when a form is sent: that is a Checkbox.