Component docs
Loading
import { ColorSwatch } from "@pixxl-tools/components";
// In Server Components:
import { ColorSwatch } from "@pixxl-tools/components/server";| Prop | Type | Default | Description |
|---|---|---|---|
color (required) | string | — | — |
label (required) | string | — | Visible label (also the accessible name). |
state | "idle" | "selected" | — | — |
colorrequiredstring
labelrequiredstring
Visible label (also the accessible name).
state"idle" | "selected"
Other props are passed to the root element (ButtonHTMLAttributes<HTMLButtonElement>), including className, style, id and aria-* attributes.
import { colors } from "@pixxl-tools/components/tokens";
<ColorSwatch color={colors.accent} label="Accent" state="selected" />