Color
Display color palettes with click-to-copy functionality
The Color component displays color swatches for documenting design systems, brand guidelines, or any color palette. Click any swatch to copy its value to the clipboard.
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>
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>
Toggle between light and dark mode to see the colors change.
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>
Properties
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.
