Swatch
A color sample: a filled rounded block with the token's name and value beneath it, the anatomy a design-system color sheet repeats down a page. Swatch owns the whole lockup, so a sheet never sets a bare block next to a hand-built text column and drifts row to row.
Pass a live theme token as color and the sample follows the active scheme; a hairline edge keeps a white or near-black sample visible on the surface behind it. The value lines are set in mono, and the lockup comes in two more sizes (small, large), as a circle, inline (the label beside the block), or as a block (a full-width ramp bar).
primary
--primary
iOS
primary
--primary
Android
primary
--primary
Web
tsx
Default
Sizes
Circle
Inline
Block
Detail line
Props
Do & Don’t
Anatomy
Don’t
Set a bare block beside a hand-composed text column: the spacing and the type scale drift row to row, and the sample ships as an unnamed block.
Do
primary
--primary
Let Swatch carry the name and the value, so every row of a sheet keeps one lockup and one accessible name.
Color source
Don’t
Hard-code the value a token resolves to; the sample keeps showing the light color after the scheme flips to dark.
Do
card
--card
Pass the live token, so the sample repaints when the scheme flips.