Component docs
Loading
"use client";
import { ColorPicker } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
swatches | readonly string[] | — | — |
defaultValue | string | — | Initial value when uncontrolled. |
onValueChange | (value: string) => void | — | Called with the new value (only when it changes). |
value | string | — | Current value (controlled); null where it means "nothing selected". |
swatchesreadonly string[]
defaultValuestring
Initial value when uncontrolled.
onValueChange(value: string) => void
Called with the new value (only when it changes).
valuestring
Current value (controlled); null where it means "nothing selected".
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
import { colors as tokens } from "@pixxl-tools/components/tokens";
const colors = [tokens.accent, tokens.success, tokens.danger];
<ColorPicker swatches={colors} />