๐Ÿ™ Onigiri

The Crunchyroll design system, rendered live from its own tokens and components. It cannot drift from what ships.

Docs draft

Badge

When to use it

useApplied filters, selected values, removable selections โ€” chips the user manipulates.
avoidRead-only metadata. If it never responds to a pointer, it is a Tag. tag
avoidStandalone actions. A chip belongs to a collection; a lone chip that submits something is a Button. button

Variants

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

mustThe close affordance always gets an accessible name (default: Remove). โ€” An icon-only button inside a chip is invisible to screen readers otherwise.
must-notDo not title-case chip labels; write them as the value they represent. โ€” Sentence-case ruling; the old TITLE transform is dead.

API

PropTypeDescription
childrenReactNodeBadge label content.
onClick() => voidMakes the chip a button.
onRemove() => voidAdds the close affordance; with onClick it splits the pill.
removeLabelstringAccessible label for the remove button.

Design specifications

radiusradius.full
heightspace.28
padding-xspace.12
padding-x-inner-seamspace.8
gapspace.4
labeltype.label-lg
fill-restcolor.bg.secondary
fill-hovercolor.bg.pressed
textcolor.text.primary
close-glyphIcon / Close at 16 (24-grid master, scales via constraints)
close-restcolor.text.secondary
close-hovercolor.text.primary
optical-nudgelabel 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.