Skip to content
Forms

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

PropTypeDefaultDescription
value
stringControlled color as a CSS color string (ideally `oklch(l c h)`).
defaultValue
stringDEFAULT_VALUEInitial color for uncontrolled usage. Defaults to a brand-ish oklch.
onValueChange
(value: string) => voidCalled 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
booleanfalseDisables the trigger and all panel controls.
aria-label
stringAccessible name for the trigger when there is no visible label.
className
stringExtra classes for the trigger button.
contentClassName
stringExtra classes for the popover panel.
id
stringNative id for the trigger.