Components/Form
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/colorpicker
Color picker allows users to select a color value by dragging the cursor inside of a color spectrum. It's a popover that should be called out via <ColorInput/>, <Button/> or another component.
It uses this color manipulation library: https://github.com/Qix-/color
<Swatches/> instead.The component consists of a color spectrum canvas, an input area, and a children area.
Set the initial color using the value prop. The children area accepts any content, typically used for color swatches.
By default, the component includes padding designed for popover use.
Remove the padding to embed the color picker inside other layouts, such as modals, panels, or cards, by setting the removePadding prop to true.
Enables to view and edit color codes in HEX/RGB/HSB formats. Converter is visible by default and can be hidden on demand by setting the showConverter to false.
Bottom actions are shown by default. To hide them for specific use cases, set the showActionButtons prop to false.
Enable the eye dropper tool using the showEyeDropper prop. When used together with the color converter, the eye dropper appears next to it. If showConverter is false, the eye dropper displays inline with the input area.
Use eyeDropperLabel prop to customize the eye dropper button label if needed.
To restrict color selection to visual picking only, hide the color value input by setting showInput to false. The showConverter prop must also be set to false.
Compare the currently active color with a newly picked one before confirming a change. Enable this by using the showHistory prop.
Allow to submit an empty value with allowEmpty prop. Use for non-mandatory color selection.
Use the emptyPlaceholder prop to define the placeholder message shown in HEX value input.
Enable users to build a custom palette by saving frequently used colors. An add button lets users add the current color to the swatches list.
Pass the <Swatches/> component to children and use the onAdd property to handle adding new swatches.
Call out the picker popover on any component click, for example <Multiselect/>.
Allow users to select a color from a list of presets by adding <Swatches/> to the children area above the submit actions.
Use colorPickerChildren props inside <ColorInput/> to let users select and input custom color values.
Use <ColorPicker/> with <Swatches/> to let users add new colors to a palette.
| Name | Type | Default | Description |
|---|---|---|---|
addTooltipContent | ReactNode | — | Defines content to show in add button tooltip. Doesn't appear if onAdd isn't passed. |
allowEmpty | boolean | false | Allows to submit when color isn't selected. Returns a color object with alpha equal to 0. |
children | ReactNode | ColorPickerChildrenRenderer | — | Defines child items to be rendered above action buttons. Accepts any kind of content, or a function that receives { changeColor } to control the picker's color and returns the content. |
dataHook | string | — | Applies a data-hook HTML attribute that can be used in the tests. |
emptyPlaceholder | string | — | Defines a placeholder text to show in an input when allowEmpty is true. |
eyeDropperLabel | string | 'Sample color' | Defines the label for the eye dropper button. |
onAdd | (color: string) => void | — | Defines an event handler for color add button click, called with the color's HEX string. If not passed, the plus icon won't be visible. |
onCancel | (color: string | Color) => void | — | Defines an event handler for cancel button click. |
onChange | (color: string | Color) => void | — | Defines an event handler for color change. |
onConfirm | (color: string | Color) => void | — | Defines an event handler for confirm button click. |
removePadding | boolean | false | Specifies whether component padding should be removed. |
showActionButtons | boolean | true | Specifies whether action buttons (confirm/cancel) should be displayed. |
showConverter | boolean | true | Specifies whether HEX/RGB/HSB converter tabs be displayed. |
showEyeDropper | boolean | false | Specifies whether eye dropper tool should be displayed. |
showHistory | boolean | false | Specifies whether current and previously used colors should be displayed. |
showInput | boolean | true | Specifies whether color input in HEX mode should be displayed. This is relevant only if showConverter is false |
value (required) | string | Color | — | Defines current color. It accepts a string or an object, in the formats supported by the color library, for example #3899EC or rgb(56, 153, 236). |
No testkit for this component — it doesn't expose a unidriver testkit.
ColorPickerProps (#14365)Last updated: 30 October 2026