Skip to Content
✨ QuickCode UI keeps growing! More components, more features, and more ways to make your projects shine. Stay tuned & maybe… hire me or sponsor me 😉 
DocumentationColorPicker

ColorPicker

A professional color picker component with support for multiple color formats, alpha channel control, preset swatches, and eyedropper functionality for sampling colors from the screen.

Install Dependencies

npx
quickcode-ui add ColorPicker

Examples

Default

A complete color picker with all features including color area, hue and alpha sliders, preset swatches, eyedropper, input field, and format toggle.

Selected Color
#3b82f6

Custom Presets

Configure custom color presets for brand colors or specific use cases.

Selected: #0ea5e9

Form Integration

Integrate multiple color pickers in a form for theme customization or configuration interfaces.

Custom Theme Builder

Configure your application theme colors

Props

ColorPicker

PropTypeDefaultDescription
valuestringControlled color value in hex format
defaultValuestring'#3b82f6'Default color value for uncontrolled usage
onValueChange(value: string) => voidCallback fired when color changes
format'hex' | 'rgb' | 'hsl'Controlled format for color display
onFormatChange(format: ColorFormat) => voidCallback fired when format changes
presetsstring[]Default color arrayArray of preset color values to display
showAlphabooleantrueWhether to show the alpha (opacity) slider
showEyeDropperbooleantrueWhether to show the eyedropper button
classNamestringAdditional CSS classes for the root element

ColorPicker.Trigger

PropTypeDefaultDescription
classNamestringAdditional CSS classes for the trigger button
childrenReact.ReactNodeContent to display inside the trigger button

ColorPicker.Content

PropTypeDefaultDescription
classNamestringAdditional CSS classes for the popover content
childrenReact.ReactNodeContent to display inside the color picker popover

ColorPicker.Area

PropTypeDefaultDescription
classNamestringAdditional CSS classes for the color area

ColorPicker.HueSlider

PropTypeDefaultDescription
classNamestringAdditional CSS classes for the hue slider

ColorPicker.AlphaSlider

PropTypeDefaultDescription
classNamestringAdditional CSS classes for the alpha slider

ColorPicker.Swatches

PropTypeDefaultDescription
classNamestringAdditional CSS classes for the swatches grid

ColorPicker.Input

PropTypeDefaultDescription
classNamestringAdditional CSS classes for the input field

ColorPicker.FormatToggle

PropTypeDefaultDescription
classNamestringAdditional CSS classes for the format select dropdown

ColorPicker.EyeDropper

PropTypeDefaultDescription
classNamestringAdditional CSS classes for the eyedropper button
Last updated on