#
%
Installation
npx shadcn@latest add @iconiq/color-pickerProps
ColorPicker
9 props
Self-contained HSV panel with saturation field, hue/alpha sliders, multi-format readouts, and EyeDropper.
value
stringControlled hex color such as #3B82F6. When provided, the picker syncs its internal state to this value.
defaultValue
stringDefault
#3B82F6Starting color for uncontrolled usage. Ignored when value is supplied.
onChange
(color: string) => voidCalled when the color settles (pointer up on sliders, blur/Enter on inputs). Emits #RRGGBB, or #RRGGBBAA when alpha is below 100%.
defaultAlpha
numberDefault
100Starting alpha percentage (0–100) for uncontrolled usage when defaultValue has no alpha channel.
disabled
booleanDefault
falseDisables picker interaction and lowers shell opacity.
reducedMotion
booleanForces reduced motion for format-menu animation and decorative pulses.
showEyedropper
booleanDefault
trueShows or hides the pipette control in the footer row.
onEyedropperUnsupported
() => voidCalled when EyeDropper is unavailable. No alert dialog is shown by default.
className
stringMerged onto the outer picker shell for width, shadow, or layout overrides.
Notes
Install with npx shadcn@latest add https://iconiqui.com/r/color-picker.json (requires lucide-react, motion, and a cn helper).
Theme tokens are embedded on the root node so the picker works without iconiq-theme, though it still maps cleanly to shadcn semantic colors.
The saturation square, hue slider, and alpha slider share one RGB source of truth. Slider drags emit on pointer up to stay stable in controlled mode.
Format switching exposes editable HEX, RGB, HSL, and OKLCH channels. Values commit on blur or Enter so partial typing does not fight the live color state.
EyeDropper support depends on the browser API (Chrome/Edge). Use onEyedropperUnsupported for user-facing feedback.
FluidColorPicker remains exported as a backward-compatible alias for older imports.