Skip to content

BlockPicker#

A color picker that lets users choose a color from a grid of available colors.

BlockPicker

Basic BlockPicker

Inherits: LayoutControl

Properties

Events

Example#


Properties#

available_colors class-attribute instance-attribute #

available_colors: Optional[list[ColorValue]] = None

A list of available colors to pick from.

color class-attribute instance-attribute #

color: Optional[ColorValue] = None

The currently selected color.

Events#

on_color_change class-attribute instance-attribute #

on_color_change: Optional[
    ControlEventHandler[BlockPicker]
] = None

Called when the picker color is changed.

The data property of the event handler argument contains the color value as a hex string.