Skip to main content

ColorPicker (ALPHA)

Alpha feature: invite only

Responsive Widgets are in alpha and available by invitation only on Business and Enterprise plans. Behavior and properties may change. To request access, open a support ticket and name the feature Responsive Widgets (ALPHA).

The ColorPicker widget lets users pick a color. Users can drag in the color area or type a hex value. The widget stores the color as a hex string, for example #2E3D49. Use it to let users choose a brand color, a theme color, or a color tag for a record.

ColorPicker widget in a Responsive app
ColorPicker widget

Widget type: WDS_COLOR_PICKER_WIDGET

Content properties​

These properties appear in the Content tab of the property pane.

Data​

Default Color string​

Sets the color shown when the widget loads. Enter a hex color in one of these forms: #rgb, #rgba, #rrggbb, or #rrggbbaa. Other formats show an error. If you change this value, the widget's color updates to match. Default: empty (no color).

Example:

#2E3D49

Allow alpha boolean​

Adds a transparency (alpha) slider. When on, the widget stores colors as #rrggbbaa. When off, the widget reads colors as #rrggbb and drops any alpha digits. Turning it back on restores the stored alpha digits. Default: off.

Label​

Text string​

Sets the label shown above the color picker. Default: Label.

Validations​

Required boolean​

Makes picking a color mandatory. When on and no color is set, the widget is invalid and shows the message "Please select a valid color" after the user interacts with it. Default: off.

General​

Tooltip string​

Shows help text or details next to the label.

Visible boolean​

Controls whether the widget is visible when the app runs. Default: on.

Disabled boolean​

Stops users from changing the color. Default: off.

Animate loading boolean​

Shows a loading animation while the widget's data loads. Default: on.

Style properties​

These properties appear in the Style tab of the property pane.

Custom styling​

These settings are in the Custom styling section, at the end of the Style tab. An empty setting uses the theme value. For theme colors, dark mode, and the rules for custom CSS, see Custom styling.

Accent color string​

Builds the hover, pressed, focus, and text colors of this widget from one color, in light and dark mode. Lists and menus that the widget opens use them too. Empty means the accent of the nearest container that sets one, or the theme accent.

Background string​

Sets the background of the input field box. Takes a theme color or a custom color.

Text color string​

Sets the text color of the input field box. Takes a theme color or a custom color. When it is empty and Background is set, the widget picks a readable text color.

Border color string​

Sets the border color of the input field box. Takes a theme color or a custom color. A color with no Border width draws a thin border.

Border width string​

Sets the border width of the input field box. Options: From theme (default), None, Thin, Medium, Thick. You cannot bind this property.

Corners string​

Sets the corner radius of the input field box. Options: From theme (default), Sharp, Rounded, Pill. You cannot bind this property.

Custom CSS string​

Adds plain CSS to this widget. Rules apply only inside the widget, and & is the box around the widget, its label included, not the part inside it. To style an inner part, use its element selector, for example button or input. You cannot bind this property.

Reference properties​

Reference properties let you read the widget's state in bindings and code, for example {{ColorPicker1.isVisible}}. You cannot set them directly.

isVisible boolean​

Shows whether the widget is visible.

Example:

{{ColorPicker1.isVisible}}

selectedColor string​

Holds the selected color as a hex string, #rrggbb or #rrggbbaa. It is an empty string when no color is set or when the stored value is not a valid hex color.

Example:

{{ColorPicker1.selectedColor}}

isDisabled boolean​

Shows whether the widget is disabled.

Example:

{{ColorPicker1.isDisabled}}

Methods​

Methods let you change the widget's properties from code, for example in a JS Object.

setVisibility (param: boolean): Promise​

Shows or hides the widget.

Example:

ColorPicker1.setVisibility(true)

setDisabled (param: boolean): Promise​

Turns the disabled state on or off.

Example:

ColorPicker1.setDisabled(false)

Events​

onColorChange​

Runs when the user finishes dragging to a new color, or commits a hex value in the input. It does not run on every step of a drag.