Color Picker

A color picker integrates a swatch with a configurable popover for color editing.

Example

Color Picker Basic Example

Value

A color area requires either a default or controlled value. Use the default_value prop to set the initial state (uncontrolled) or the value prop to control the current state.

Labeling

A visual label can be provided using the label prop. If a visible label isn’t specified, an aria_label prop should be provided for accessibility.

Events

Color pickers accept an on_change prop which triggers when the value is edited.

Visual Options

The appearance of the color picker can be customized using various visual options such as hiding the alpha channel, adjusting rounding, and changing the size.

Hide alpha channel

Rounding

Size

Table Formatting

API reference

A ColorPicker combines a swatch with a customizable popover for editing a color.

Returns: Element The rendered color picker.

ParametersTypeDefaultDescription
*childrenAnyElements to render in the color picker.
labelAnyNoneThe label for the color picker.
sizestr'M'The size of the color picker.
roundingstr'default'The rounding of the color picker.
valuestr |
None
NoneThe current value of the color picker.
default_valuestr |
None
NoneThe default value of the color picker.
hide_alpha_channelbool |
None
NoneWhether to hide the alpha channel in the color picker.