Skip to content
caliper ui pro docs

Color picker

Pick a colour from swatches or a free spectrum, with a contrast readout.

Pro
Contact supportRead the setup guide

When to use

  • Accent and label colours in settings.
  • You want to warn when a colour has low contrast.

When not to use

  • Only a fixed palette is allowed; use chips or radio cards.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/color-picker

Adds its 3 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

ColorPicker

8 props
PropTypeDefault
label *string—
swatchesreadonly ColorSwatch[][]
valuestring—
defaultValuestring—
onValueChange((value: string) => void)—
backgroundstring"#ffffff"
namestring—
classNamestring—

Keyboard

Escape
Closes or cancels, then returns focus to where it came from.
→
Moves to the next item or value.
←
Moves to the previous item or value.
↑
Moves to the previous item or value.
↓
Moves to the next item or value.

Accessibility

It exposes dialog and slider semantics, with aria-haspopup, aria-expanded, aria-hidden, aria-label, aria-roledescription and aria-valuemin kept in step with state.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/color-picker.md

The index of every part is at /llms.txt.

More in Color