Color Picker
The iOS 26 system color picker: Grid, Spectrum and Sliders, an Opacity slider and saved colors, and the color well that opens it in a popover or, on a phone, a sheet.
import { ColorPicker, ColorWell } from "@plexui/ui/components/ColorPicker";A color well shows a color and opens the system color picker, where people choose a color from a grid, a spectrum or sliders, set its opacity and save colors they use again, as in iOS 26. Use ColorWell for a setting that is a color; use ColorPicker on its own to put the picker in a surface of your own.
Examples
Color well
Sizes and states
Picker
Without opacity
API
ColorWell
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | null | — | The controlled color, `#rrggbb` or `#rrggbbaa`; `null` shows the well with no color |
defaultValue | string | null | null | The color when it is initially rendered |
onChange | (value: string) => void | — | Called with the color the picker chose |
size | "sm" | "lg" | "sm" | 28px or 36px |
title | string | "Colors" | The title of the picker |
supportsEyedropper | boolean | true | Shows the eyedropper where the browser has the EyeDropper API |
disabled | boolean | false | Prevents opening the picker |
name | string | — | Submits the color with the owning form |
aria-label | string | "Color" | Accessible name of the well |
aria-labelledby | string | — | The `id` of the visible label of the well |
The well also takes the picker props supportsAlpha, mode, defaultMode, onModeChange, swatches, defaultSwatches and onSwatchesChange.
ColorPicker
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | The controlled color, `#rrggbb` or `#rrggbbaa` |
defaultValue | string | "#000000" | The color when it is initially rendered |
onChange | (value: string) => void | — | Called with the next color: `#rrggbb`, or `#rrggbbaa` when it is not opaque |
supportsAlpha | boolean | true | Shows the Opacity slider |
mode | "grid" | "spectrum" | "sliders" | — | The controlled way to choose a color |
defaultMode | "grid" | "spectrum" | "sliders" | "grid" | The way to choose a color when it is initially rendered |
onModeChange | (mode) => void | — | Called when another way is chosen |
swatches | string[] | — | The controlled saved colors |
defaultSwatches | string[] | [] | The saved colors when it is initially rendered |
onSwatchesChange | (swatches: string[]) => void | — | Called after Add saves the current color or Delete removes one |
aria-label | string | "Colors" | Accessible name of the picker |
The well is a button, described by its color. In the picker, Grid and the saved colors are radio groups: the arrow keys move and choose, Home and End go to the ends of a row in Grid and to the first and last saved color. Spectrum is a slider: Up and Down change the hue, Left and Right the lightness, by 1%, or 10% with Shift or Page Up and Page Down. The Opacity and channel sliders are sliders, and their fields take a typed value on Enter or when they lose focus.
Styling
ColorPicker and ColorWell read these component tokens. Override them at any scope to restyle them:
--color-picker-width: the picker's column (default264px, the full width of the sheet on a phone)--color-picker-body-radius: the corner of the grid and the spectrum (defaultvar(--radius-xl),18pxon a phone)--color-picker-selection-color: the ring of the selected cell, swatch, knob and loupe (default#fff)--color-picker-track-heightand--color-picker-knob-size: the sliders (default28pxand24px,40pxand36pxon a phone)--color-picker-field-background: the fields and Add (defaultvar(--color-background-secondary-soft-alpha),var(--alpha-12)on a phone)--color-picker-separator-color: the line over the saved colors (defaultvar(--color-border),var(--alpha-25)on a phone)--color-picker-swatch-size: a saved color (default24px,30pxon a phone)--color-well-size-smand--color-well-size-lg: the well (default28pxand36px)--color-well-rainbow: the ring of the well (the kit's angular gradient)