Color Picker
OKLCH-native color input on a popover, with an area, hue slider and swatches.
Import
tsx
import { ColorPicker } from "@cooud-ui/ui";
bash
npx cooud-ui add color-picker
Examples
API Reference
Generated from the component's exported types.
ColorPickerProps
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled color as a CSS color string (ideally `oklch(l c h)`). |
defaultValue | string | DEFAULT_VALUE | Initial color for uncontrolled usage. Defaults to a brand-ish oklch. |
onValueChange | (value: string) => void | — | Called with the new color, serialized as `oklch(l c h)`, on every change. |
swatches | string[] | DEFAULT_SWATCHES as unknown as string[] | Preset swatches shown as a row; clicking one selects it. |
disabled | boolean | false | Disables the trigger and all panel controls. |
aria-label | string | — | Accessible name for the trigger when there is no visible label. |
className | string | — | Extra classes for the trigger button. |
contentClassName | string | — | Extra classes for the popover panel. |
id | string | — | Native id for the trigger. |