Skip to content
TrademarkTrademark
Docs
Form Controls

ColorPicker

Updated: November 28, 2026
View on GitHub
Soon
Not released yet. The published package does not include this yet, so it will not install today.

ColorPicker is the panel ColorInput opens. Use it on its own where the picker should stay on screen: a theme editor, a side panel, a popover you place yourself.

What it has

  • Area and tracks: drag the saturation and brightness area, the hue track and, with supportAlpha, the opacity track. Each is a slider for the keyboard too: arrow keys, Shift for bigger steps, Home and End.
  • Formats: a switch between HEX, RGB and OKLCH. HEX and OKLCH have one compact field that takes a colour typed in any format (on Enter or blur); RGB has a field per channel, plus A with supportAlpha, each stepped by the arrow keys (Shift by 10). onValueChange reports the colour in the chosen format; format and onFormatChange control it.
  • Eyedropper: picks a colour from anywhere on screen, where the browser offers it (Chromium today). Hidden elsewhere, or with eyeDropper={false}.
  • Swatches: the theme's brand, accent and neutral colours come first (themeSwatches={false} hides them), then your swatches.

In a ColorInput

ColorInput opens this picker by default. swatches and pickerLabels pass through to it, and picker="native" brings back the browser's own picker.

Saving a pick

onValueChange fires on every move of a drag, for a live preview. onValueCommit fires once when the pointer lets go, a key changes the colour, or a typed value or swatch is taken: save, send or record an undo step there.

Localisation

labels names the controls for assistive technology: area, hue, alpha, eyeDropper, format, the RGB fields red, green and blue, swatches, and the theme swatches brand, accent and neutral. Whatever you leave out stays English.

Props

Type
Default
value
string—
defaultValue
string#808080
onValueChange
(value: string) => void—
onValueCommit
(value: string) => void—
supportAlpha
booleanfalse
format
hexrgboklch
—
onFormatChange
(format: ColorFormat) => void—
swatches
string[]—
themeSwatches
booleantrue
eyeDropper
booleantrue
disabled
booleanfalse
labels
ColorPickerLabels—
…and every LeafProps propinherited—
Edit this page on GitHub