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

Appearance

Sizes and states

Picker

Opacity
#be38f3

Without opacity

Red
Green
Blue
Hex Color #

API

ColorWell

PropTypeDefaultDescription
valuestring | null—The controlled color, `#rrggbb` or `#rrggbbaa`; `null` shows the well with no color
defaultValuestring | nullnullThe color when it is initially rendered
onChange(value: string) => void—Called with the color the picker chose
size"sm" | "lg""sm"28px or 36px
titlestring"Colors"The title of the picker
supportsEyedropperbooleantrueShows the eyedropper where the browser has the EyeDropper API
disabledbooleanfalsePrevents opening the picker
namestring—Submits the color with the owning form
aria-labelstring"Color"Accessible name of the well
aria-labelledbystring—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

PropTypeDefaultDescription
valuestring—The controlled color, `#rrggbb` or `#rrggbbaa`
defaultValuestring"#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
supportsAlphabooleantrueShows 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
swatchesstring[]—The controlled saved colors
defaultSwatchesstring[][]The saved colors when it is initially rendered
onSwatchesChange(swatches: string[]) => void—Called after Add saves the current color or Delete removes one
aria-labelstring"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 (default 264px, the full width of the sheet on a phone)
  • --color-picker-body-radius: the corner of the grid and the spectrum (default var(--radius-xl), 18px on a phone)
  • --color-picker-selection-color: the ring of the selected cell, swatch, knob and loupe (default #fff)
  • --color-picker-track-height and --color-picker-knob-size: the sliders (default 28px and 24px, 40px and 36px on a phone)
  • --color-picker-field-background: the fields and Add (default var(--color-background-secondary-soft-alpha), var(--alpha-12) on a phone)
  • --color-picker-separator-color: the line over the saved colors (default var(--color-border), var(--alpha-25) on a phone)
  • --color-picker-swatch-size: a saved color (default 24px, 30px on a phone)
  • --color-well-size-sm and --color-well-size-lg: the well (default 28px and 36px)
  • --color-well-rainbow: the ring of the well (the kit's angular gradient)