build69
build69  /  Components  /  Selection & Choice  /  ColorPicker

ColorPicker

v1.0.1NewUpdated 18 Jul 2026

Dependency-free HSV color picker with a 2D saturation/brightness area, hue slider, optional alpha slider (checkerboard), hex + RGB(A) inputs, preset swatches and an eyedropper button when the browser supports window.EyeD

Preview

Live · 11 stories
DefaultOpen ↗
Why this is recommendedcolorcolourpickerswatch+6

The default, out-of-the-box ColorPicker.

Recommended for+14
  • Brand / theme colour settings
  • Invoice or label template colours
  • Tag and calendar colour assignment
  • Chart series colour overrides
Tags+6
colorcolourpickerswatchhsvhexrgbaeyedropperbranddefault
Features+4
  • 2D saturation/brightness area with pointer drag + arrow keys
  • Hue slider (0–360°)
  • Optional alpha slider with checkerboard track
  • Hex + R/G/B (+ A) inputs with draft-and-commit editing
  • Preset swatches with accessible labels + aria-pressed
  • Eyedropper (feature-detected, SSR-safe)
  • Inline panel or popover swatch trigger
  • Controlled + uncontrolled (hex in, hex/rgba out)
  • Full keyboard operability, polite value announcements
  • Sizes sm / md / lg
  • i18n: labels prop overrides every built-in string (slider aria + valuetext templates, captions, announcements); numbers format via LocaleProvider
Not recommended for−2
  • Choosing from a small fixed palette only (render preset swatch buttons instead)
  • Gradient editing

Install

Ask your agent, or call the MCP tool directly. The resolved bundle is written into your project.

get_registry_item({ name: "ColorPicker" })

Usage

import { ColorPicker } from '@/components/inputs/color-picker';

<ColorPicker variant="popover" value={brand} onValueChange={setBrand} presets={['#166534', '#ea580c', '#0e7490']} showAlpha />

Tick variants in the left menu — each adds a tab with that variant’s real story source, the same code the preview above renders.

Props

PropTypeRequired
value

Controlled colour — hex or rgba() string

string
defaultValue

Initial colour (uncontrolled)

string
onValueChange

Emits hex, or rgba() when alpha < 1

function
variant

Inline panel or swatch button + popover

'inline' | 'popover'
size

Panel / trigger sizing

'sm' | 'md' | 'lg'
showAlpha

Show alpha slider + A input

boolean
presets

Preset swatches (value + optional label)

(string | ColorPickerPreset)[]
showEyeDropper

Hide the eyedropper even when supported

boolean
disabled

Disable all controls

boolean
labels

Override every built-in UI string — slider names + valuetext templates, input captions, eyedropper, live announcement (i18n). Merged over DEFAULT_COLOR_PICKER_LABELS.

Partial<ColorPickerLabels>

Related