ColorSwatch
ImplementedColor preview block — 24×24 rounded square with hex/RGB tooltip. Used in design system docs and theme editor.
patterns/atoms/colorswatch.htmlToken-aware color preview tile. FR-CA: Échantillon de couleur avec jeton.
ColorSwatch
Display atom (Family 2 — Tier 1, placeholder)
Tier-1 placeholder. Production component ships in DS-313.
ep-teal
#009FCA
ep-semantic-success
#16A34A
ep-semantic-warning
#D97706
ep-semantic-error
#DC2626
ep-text-heading
#1A2332
This component supports light and dark mode.
Status
Tier-1 placeholder. Production component ships in DS-313.
Intended API
import { ColorSwatch } from '@epasslive/design-system'
<ColorSwatch token="ep-teal" label="Sarcelle" />
<ColorSwatch token="ep-semantic-error" label="Erreur" size="sm" />Accessibility
The wrapper renders role="img" with an explicit French label.
Props
tokenstringep-tealTailwind token key.
hexstring#009FCAResolved hex value.
labelstringTealFrench label announced to assistive tech.
size'sm' | 'md' | 'lg'mdVisual size of the swatch tile.
Props
ColorSwatch
colorstring—CSS color value (hex, rgb, hsl)
namestring—Form/field name.
size"sm" | "md" | "lg"'md'Visual size preset.
onClick() => void—Called when the element is activated.
<ColorSwatch />Accessibility
Type
1 ruleARIA
1 ruleUsage
Import
import { ColorSwatch } from "@epasslive/design-system"Example 1
<ColorSwatch />Example 2
<ColorSwatch variant="default" />Anti-patterns
— Do not compose atoms directly — use molecules instead
— Avoid inline styles on atoms