Components / forms
Chip
A small control the reader turns on and off, or takes away — a filter, a selected tag.
Summary
A small control the reader turns on and off, or takes away — a filter, a selected tag.
| APG pattern | Button |
| Built on | native elements |
| Status | self-tested |
| Since | 0.7.0 |
<Chip pressed={filters.has('live')} onPressedChange={(on) => toggle('live', on)}>Live</Chip>
<Chip onDismiss={() => remove('Design')} dismissLabel="Remove Design">Design</Chip>
<Chip pressed onPressedChange={set} onDismiss={clear} dismissLabel="Remove Open">Open</Chip>
A chip toggles, or can be removed, or both. Without either it is a Badge.
Anatomy
A <span data-se="chip" data-se-text="ui"> that draws the pill — the type role is part of the anatomy, as Button's is. Inside it, the words sit in control — a <button> carrying aria-pressed — when the chip toggles, and in label when it does not. A removable chip adds close, a second <button> with one job. Two buttons side by side is why the root is a span: a button cannot hold a button.
| Part | Element | Required |
|---|---|---|
close | <button> | no |
control | <button> | yes |
label | <span> | yes |
<span data-se="chip" data-se-text="ui">
<button type="button" data-part="control" aria-pressed="true">Live</button>
</span>
<span data-se="chip" data-se-text="ui">
<span data-part="label">Design</span>
<button type="button" data-part="close" aria-label="Remove Design">
<svg aria-hidden="true">…</svg>
</button>
</span>
One of control and label is always present; the binding picks by whether onPressedChange was passed.
Properties
| Property | Values | Default | What it does |
|---|---|---|---|
pressed | boolean | false | Whether the chip is on. Written to aria-pressed on control, so the state reaches the screen reader and the CSS from one attribute. |
onPressedChange | (pressed: boolean) => void | none | Called with the next value when the reader toggles it. Passing it is what makes the words a button; without it the chip does not toggle and the words are plain. |
onDismiss | () => void | none | Adds the close button. The chip does not remove itself — the caller owns the list it sits in, and removing from a list the component cannot see is how a chip and its data disagree. |
dismissLabel | string | Remove | The close button's accessible name. Say what is removed — Remove Design — because a row of close buttons all named Remove is a row a screen reader cannot tell apart. |
disabled | boolean | none | Not usable, not focusable. Both buttons take disabled; the root takes data-disabled, because a span is not a form control. |
children | React.ReactNode | none | The words. A chip is one short label; it has no icon slots, and a count beside the words is text. |
No intent. Pressed is the chip's one color, and a second color on a toggle says two things with one channel — the same ruling Carousel's dots took in 0.6. A state worth a color is a Badge beside the chip, not the chip.
States
| State | Expressed as | |
|---|---|---|
| Disabled | :disabled | |
| Focused | :focus-visible | |
| Hover | :hover | |
| Pressed | aria-pressed | |
| Disabled | data-disabled |
aria-pressed is written as true or false whenever the chip toggles, never absent-for-false: a toggle button whose attribute comes and goes reads as two different controls to a screen reader.
Behavior
Activating control calls onPressedChange with the opposite of pressed. Activating close calls onDismiss. Neither changes anything on its own; the caller re-renders with the new state, and a chip whose caller ignores the call stays where it was. A disabled chip answers neither.
Accessibility
A toggle is a button with aria-pressed, from the APG. Not a checkbox: a checkbox submits a value, a toggle changes the page now. The platform gives the button its role, its name and its keys.
Two controls, two names. The close button cannot share the toggle's name, so it takes dismissLabel as an aria-label, and the caller is asked to name the thing removed.
Removal moves focus, and that is the caller's job. When a chip is removed, focus is on an element that no longer exists. The caller moves it — to the next chip, or to the input the chips belong to. The component cannot know which, and must not guess.
Keyboard
| Key | Result |
|---|---|
Enter, Space | Toggles control, or activates close, from the platform. Nothing here re-implements them. |
Delete and Backspace do not remove a chip. That contract belongs to the tag input — Combobox choosing several, which is built on this component — where the input owns the keys.
Roles, states and properties
| Attribute | Set by |
|---|---|
aria-hidden | always true |
aria-label | set at render |
aria-pressed | set at render |
Focus
Each button is a normal tab stop; a chip with both has two. Focus stays on control after a toggle. After a removal there is nothing to stay on — see above.
Screen reader
Not recorded as verified. Stage 4 of the readiness ladder — driving each component with VoiceOver and NVDA — is unstarted across the package, and no component should claim otherwise until docs/journal/ records the session that did it.
Contrast and target size
npm run check:contrast audits every color pair this component uses across all four skins, light and dark, and fails the build on a shortfall. Two waivers are on the record in docs/audit/DEFERRED.md.
It takes the touch floor under (pointer: coarse) — the visual size is unchanged on a desktop pointer.
Tested
test/apg/badge-chip.test.jsxtest/apg/client-boundary.test.jsxtest/browser/badge-chip.spec.mjs
Known gaps
_No upstream requirement is recorded as not applicable._
Appearance
A pill at the small control height, the ui type role inside, a hairline border. Pressed takes the soft accent fill with an accent border and accent text — the one state that changes its color. Hover darkens the border; disabled takes the sunk surface and the disabled text. The buttons inside draw nothing of their own: the pill is the root's, and the focus ring is drawn on the root through :has(:focus-visible) so it surrounds the whole chip rather than one of its two halves.
| Token | Used for |
|---|---|
--se-accent | border-color |
--se-accent-soft | background |
--se-accent-text | color |
--se-border | border-color |
--se-border-hover | border-color |
--se-border-strong | border |
--se-border-width | border |
--se-control-h-sm | block-size |
--se-duration-instant | transition |
--se-ease-standard | transition |
--se-focus-color | outline |
--se-focus-offset | outline-offset |
--se-focus-width | outline |
--se-icon-sm | block-size, inline-size |
--se-radius-pill | border-radius |
--se-space-2 | padding-inline |
--se-space-3 | padding |
--se-surface | background |
--se-surface-sunk | background |
--se-target-min | min-block-size |
--se-text | color |
--se-text-disabled | color |
--se-text-muted | color |
Motion
Background and border color cross --se-duration-instant on toggle and hover. Nothing moves. A chip that is removed leaves at once; the list it sat in may animate the gap closing, and that is the list's decision.
Content
One or two words, sentence case, the noun the reader chose. Design, Live, Last 30 days. A chip that reads as a sentence is doing a Button's job.
The close name says what goes. Remove Design, not Remove and not ×.
Usage
Chip acts; Badge names. A thing the reader cannot change is a Badge. The builder's .cc-chip was both — forty-four uses in nine files, a handful of them pressable — and the split is the point of having two components.
A set of filters is a set of chips, each its own toggle. Chips in a row are not a radio group: several can be on at once, and that is what makes them chips. If exactly one must be on, use Tabs or a SegmentedControl.
A removable chip is a value, not a filter. It means this is chosen, and taking it away unchooses it. The tag input is the usual home, and it owns the keys.
When not to use it. For an action — Publish, Delete — use a Button; a chip's shape promises a state, not an outcome. For a state the reader only reads, Badge.
Notes
Split from Badge on 15 Oct 2026 (both plans). Three apps had one class doing both jobs. The toggle got the name Chip; the dot went to Badge as its status part.
The root is a span because a button cannot contain a button. A removable toggle needs two controls, and the only valid way to draw one pill around two buttons is to draw it on a parent. The cost is that the focus ring is drawn through :has(), which the contract already relies on for Card.
control and label are alternatives, not a pair. The words are a button only when they can be pressed. Rendering a <button> that does nothing would give a screen reader a control with no effect.
No intent axis — recorded under Properties. The evidence was a filter row in the builder that colored each chip by the status it filtered; the review read it as a Badge's color on a Chip's job, and the two components answer it apart.