selectColor()

Opens the editor's color picker for the selected component, letting a Wix user choose a solid color or gradient.

Syntax

Copy

Parameters

params accepts one of the following shapes:

For more information on this choice, see Picker arguments.

Manifest key

Connects the picker to a manifest style field, so the selected color saves to it automatically.

NameTypeDescription
styleItemKeystringKey of a cssProperties or cssCustomProperties field in the manifest. The editor reads the current value, opens the picker, and saves the selection back to this field automatically.

Explicit options

Opens the picker without connecting it to the manifest. Use the callbacks to preview and apply the color yourself.

NameTypeDescription
initialValuestringInitial color to show when the picker opens, as a CSS color string.
modestring[]Color modes to offer. Defaults to ['solid']. Include 'gradient' to also allow gradients.
showBrandbooleanWhether to show the site's brand color palette.
showCustombooleanWhether to show the custom color input.
showAdvancedSettingsbooleanWhether to show the advanced settings panel.
showOpacitybooleanWhether to show the opacity slider.
positionobjectScreen position { x, y } where the picker should open.
onChangefunctionCalled with the color string on every change while the picker is open.
onApplyfunctionCalled with the color string when the Wix user confirms a selection.
onClosefunctionCalled when the picker closes, whether or not a color was confirmed.
onCancelfunctionCalled when the Wix user cancels without confirming a selection.

Returns

Promise<string | undefined>

When called with a manifest key, resolves with the updated color value once it's applied. When called with explicit options, use the onChange and onApply callbacks to receive color values as the Wix user interacts with the picker.

Example

Copy

See also

Last updated: 8 September 2026

Did this help?