Docs draft
Badge
Component storyFigma component set โReact component โDSDS entity โ
When to use it
tagbuttonVariants
type ยท label / label-with-close / two-button โ Mirrors the old matrix 1:1. In code the axis is derived from props: onClick = Label behavior, onRemove = Label with Close, both = Two Button (split pill, separate targets).
States
default โ The default resting appearance.
hover โ Pointer is over the control.
focus โ Holds keyboard focus and shows the focus ring.
close hover โ Pointer is over the close control.
close focus โ The close control holds keyboard focus.
Guidelines
API
| Prop | Type | Description |
|---|---|---|
children | ReactNode | Badge label content. |
onClick | () => void | Makes the chip a button. |
onRemove | () => void | Adds the close affordance; with onClick it splits the pill. |
removeLabel | string | Accessible label for the remove button. |
Design specifications
| radius | radius.full |
| height | space.28 |
| padding-x | space.12 |
| padding-x-inner-seam | space.8 |
| gap | space.4 |
| label | type.label-lg |
| fill-rest | color.bg.secondary |
| fill-hover | color.bg.pressed |
| text | color.text.primary |
| close-glyph | Icon / Close at 16 (24-grid master, scales via constraints) |
| close-rest | color.text.secondary |
| close-hover | color.text.primary |
| optical-nudge | label line-height 24 (not 22) inside the 28px chip โ DM Sans reads ~1px high when geometrically centered; the line-height route nudges glyphs only, leaving icons at true center |
Accessibility
Enter / Space โ Activates the focused segment (chip or close).
Tab โ Split pills expose two stops: chip, then close.
color.text.primary on color.bg.secondary โ Contracted at โฅ 4.5:1 by the build gate.
color.text.primary on color.bg.pressed โ Contracted at โฅ 4.5:1 by the build gate.
Close renders a real button with an aria-label. Static badges are spans and take no focus.