Color Property
Sets the color of a component. Uses predefined theme colors or accepts custom values in hex, rgb, or raw rgb formats.import { Badge } from "@locus-ui/components";
<Badge color="primary" variant="solid"> Primary</Badge>Examples
Theme Colors
Thecolor prop accepts semantic theme values: primary, secondary, tertiary, success, warning, danger, and info.
theme-colors.tsx
import { Badge } from "@locus-ui/components";
const themeColors = [ "primary", "secondary", "tertiary", "success", "warning", "danger", "info",];
return themeColors.map((color) => ( <Badge key={color} color={color} variant="solid"> {color} </Badge>));Palette Colors
Additional named palette colors are available:red, orange, yellow, green, blue, purple, gray, maroon, cyan, navy, teal, lime, magenta, and white.
palette-colors.tsx
import { Badge } from "@locus-ui/components";
const paletteColors = [ "red", "orange", "yellow", "green", "blue", "purple", "gray", "maroon", "cyan", "navy", "teal", "lime", "magenta", "white",];
return paletteColors.map((color) => ( <Badge key={color} color={color} variant="solid"> {color} </Badge>Custom Colors
Thecolor prop also accepts custom values in hex, rgb(), or raw RGB formats.
custom-colors.tsx
import { Badge } from "@locus-ui/components";
<Badge color="#7BEB34" variant="solid">Hex</Badge><Badge color="rgb(125, 235, 52)" variant="solid">RGB</Badge><Badge color="125, 235, 52" variant="solid">Raw RGB</Badge>