Basic usage
Props
ColorPicker (Root)
ColorLike
The controlled color value. Can be any valid CSS color string.
ColorLike
default:"'#ffffff'"
The default color value for uncontrolled usage.
(value: string, mode: string) => void
Callback fired when the color value changes. Receives the color string and current mode.
'hex' | 'rgb' | 'hsl'
The controlled color mode.
'hex' | 'rgb' | 'hsl'
default:"'hex'"
The default color mode for uncontrolled usage.
(mode: ModeType) => void
Callback fired when the color mode changes.
ColorPicker.Area
The 2D color selection area for saturation and lightness.ColorPicker.Hue
The hue slider for selecting the base color.ColorPicker.Alpha
The alpha/opacity slider.ColorPicker.Input
The text input for entering color values.ColorPicker.Mode
The mode selector for switching between HEX, RGB, and HSL.Controlled color picker
With alpha channel
With mode selector
Controlled mode
Without alpha
Custom layout
Theme color picker example
With preview swatch
Different color formats
Accessibility
- All interactive elements (area, sliders, inputs) are keyboard accessible.
- The color area supports arrow key navigation for precise color selection.
- Sliders support arrow keys for adjusting values.
- The input field allows direct color value entry.
- Focus states are clearly visible on all interactive elements.
- Color values are properly validated and converted between formats.