Lucent UI
← DateRangePickerColorPickerSlider →
✦ LLM-ready

ColorPicker

atom

Fully-featured color selection component. Opens a portaled popover (zIndex 999999) with a spectrum panel, hue and alpha sliders, four input formats (Hex, RGB, HSL, HSB), eyedropper support, and multi-group preset palettes. Supports compact size and inline label placement.

"Add a ColorPicker from lucent-ui with a label and preset color groups. Handle state with useState."

Usage

React / JSX
import { ColorPicker } from 'lucent-ui'

<ColorPicker label="ColorPicker" size="md" />

Installation

pnpm add lucent-ui

API Reference

ColorPicker props — * required

PropTypeDefaultDescription
value*string—Current color value (any CSS color string).
onChange*(color: string) => void—Callback fired when the color changes.
labelstring—Label displayed above the trigger swatch.
size"sm" | "md""md"Trigger swatch size. sm renders a compact 24px swatch.
inlinebooleanfalsePlaces the label beside the swatch instead of above it.
presetGroupsColorPresetGroup[]—Array of { label, colors } groups. Single group hides the switcher; multiple groups show a dropdown.
disabledbooleanfalsePrevents interaction.