Skip to content
FormsFree

Color Picker

Pick a colour: saturation and brightness, hue, opacity, eyedropper, HEX/RGB/HSL values and saved colours — inline or from a trigger field.

Usage

Color picker

Saved colours

Installation

bash
npm install @wunderui/react

Then import what you need:

tsx
import {
  ColorPicker,
  ColorPickerProps,
  ColorPickerTrigger,
} from "@wunderui/react"

Examples

Default

The panel with the value in HEX. Drag in the area or on the sliders, or use the arrow keys (Shift for big steps).

Color picker

Saved colours

Swatch grid

variant="grid" swaps the area for a grid of greys and nine shades of twelve hues. Arrow keys move through the grid.

Color picker

Saved colours

RGB and HSL

The select switches the value fields; set the starting format with defaultFormat.

Color picker

Saved colours

Color picker

Saved colours

Trigger

ColorPickerTrigger is the field that opens the picker in a popover — swatch, hex value, chevron.

In context

How the component is used inside real screens — the same compositions as the Usage section of the Figma page.

Brand colour setting

A settings card with a labelled trigger; the preview follows the colour as you pick.

Brand colour
Buttons, links, focus rings and the first chart series use it.

Preview: View report

API Reference

PropTypeDefault
variant"spectrum" | "grid""spectrum"
value / defaultValue / onValueChangestring (#RRGGBB)"#555CF3"
alpha / defaultAlpha / onAlphaChangenumber (0–1)1
showAlphabooleantrue
format / defaultFormat / onFormatChange"hex" | "rgb" | "hsl""hex"
swatches / defaultSwatches / onSwatchesChangestring[]nine WunderUI hues
titleReactNode | null"Color picker"
onClose() => void— (shows the close button)
ColorPickerTriggervalue, defaultValue, onValueChange, label, pickerProps, side, align—