Color
The Color component displays color palettes for documenting design systems, brand guidelines, or any color specification.
Color displays hex, RGB, and RGBA values as click-to-copy swatches. Two layout variants -- a compact grid and a grouped table -- with built-in light/dark mode support.
Use Color when:
- Documenting design systems with brand colors
- Showing theme colors for light and dark modes
- Displaying color scales (primary-100 through primary-900)
- Sharing brand guidelines with hex/RGB values
Usage
<Color>
<ColorItem name="Primary" value="#635BFF" />
</Color>
Compact Variant
The default layout displays colors in a responsive grid:
#3b82f6#22c55e#f59e0b#ef4444<Color>
<ColorItem name="Primary" value="#3b82f6" />
<ColorItem name="Success" value="#22c55e" />
<ColorItem name="Warning" value="#f59e0b" />
<ColorItem name="Error" value="#ef4444" />
</Color>
Table Variant
Group colors into labeled rows for organized palettes:
#3b82f6#6366f1#22c55e#ef4444<Color variant="table">
<ColorRow title="Brand Colors">
<ColorItem name="Primary" value="#3b82f6" />
<ColorItem name="Secondary" value="#6366f1" />
</ColorRow>
<ColorRow title="Feedback Colors">
<ColorItem name="Success" value="#22c55e" />
<ColorItem name="Error" value="#ef4444" />
</ColorRow>
</Color>
Color Naming Conventions
| Pattern | Example | Use For |
|---|---|---|
| Semantic | success, error, warning | Feedback colors |
| Numeric scale | primary-500, gray-100 | Color palettes |
| Descriptive | brand-blue, accent-gold | Brand colors |
Theme-Aware Colors
Define different colors for light and dark modes by passing an object with light and dark properties:
#ffffff#171717#e5e5e5<Color>
<ColorItem name="Background" value={{ light: "#ffffff", dark: "#0a0a0a" }} />
<ColorItem name="Foreground" value={{ light: "#171717", dark: "#ededed" }} />
<ColorItem name="Border" value={{ light: "#e5e5e5", dark: "#404040" }} />
</Color>
Color Formats
The component supports standard CSS color formats:
#3b82f6rgb(59, 130, 246)rgba(59, 130, 246, 0.8)<Color>
<ColorItem name="Hex" value="#3b82f6" />
<ColorItem name="RGB" value="rgb(59, 130, 246)" />
<ColorItem name="RGBA" value="rgba(59, 130, 246, 0.8)" />
</Color>
Props
Color
stringdefault: compactLayout style: compact (grid) or table (grouped rows).
nodeColorItem or ColorRow elements.
ColorRow
stringLabel displayed above the row.
nodeColorItem elements.
ColorItem
stringDisplay name for the color.
string | objectColor value as CSS string, or { light: string, dark: string } for theme-aware colors.
