Flutter docs
Default skin

ColorPicker

Used for color selection.

When to use

Used when the user needs to make a customized color selection.

Examples

Basic Usage

Basic Usage.

controlled mode

Set the component to controlled mode. Will lock the display color if controlled by onChangeComplete.

Rendering Trigger Text

Renders the default text of the trigger, effective when showText is true. When customizing text, you can use showText as a function to return custom text.

Disabled Alpha

Disabled color alpha.

Custom Trigger

Triggers for customizing color panels.

Color Format

Encoding formats, support HEX, HSB, RGB.

Custom Render Panel

Rendering of the free control panel via panelRender.

Trigger size

Ceebee UI supports three trigger sizes: small, default and large. If a large or small trigger is desired, set the size property to either large or small respectively. Omit the size property for a trigger with the default size.

Line Gradient

Set the color to a single or a gradient color via mode.

Disable

Set to disabled state.

Clear Color

Clear Color.

Custom Trigger Event

Triggers event for customizing color panels, provide options click and hover.

Preset Colors

Set the presets color of the color picker.

Custom semantic dom styling

You can customize the semantic dom style of ColorPicker by passing objects/functions through classNames and styles.

API

ColorPicker are exported from @ceebee/ui/client.

ColorPicker

PropertyDescriptionTypeDefaultVersion
allowClearAllow clearing color selectedbooleanfalse—
arrowConfiguration for popup arrowboolean | { pointAtCenter: boolean }true—
childrenTrigger of ColorPickerReact.ReactNode-—
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-—
defaultValueDefault value of colorColorType-—
defaultFormatDefault format of colorrgb | hex | hsbhex5.9.0
disabledDisable ColorPickerboolean-—
disabledAlphaDisable Alphaboolean-5.8.0
disabledFormatDisable format of colorboolean-5.22.0
destroyTooltipOnHideWhether destroy dom when closebooleanfalse5.7.0
destroyOnHiddenWhether destroy dom when closebooleanfalse5.25.0
formatFormat of colorrgb | hex | hsb-—
modeConfigure single or gradient color'single' | 'gradient' | ('single' | 'gradient')[]single5.20.0
openWhether to show popupboolean-—
presetsPreset colorsPresetColorType-—
placementPlacement of popupThe design of the placement parameter is the same as the Tooltips component.bottomLeft—
panelRenderCustom Render Panel(panel: React.ReactNode, extra: { components: { Picker: FC; Presets: FC } }) => React.ReactNode-5.7.0
showTextShow color textboolean | (color: Color) => React.ReactNode-5.7.0
sizeSetting the trigger sizelarge | medium | smallmedium5.7.0
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-—
triggerColorPicker trigger modehover | clickclick—
valueValue of colorColorType-—
onChangeCallback when value is changed(value: Color, css: string) => void-—
onChangeCompleteCalled when color pick ends. Will not change the display color when value controlled by onChangeComplete(value: Color) => void-5.7.0
onFormatChangeCallback when format is changed(format: 'hex' | 'rgb' | 'hsb') => void-—
onOpenChangeCallback when open is changed(open: boolean) => void-—
onClearCalled when clear() => void-5.6.0

Color

PropertyDescriptionTypeDefaultVersion
toCssStringConvert to CSS support format() => string5.20.0—
toHexConvert to hex format characters, the return type like: 1677ff() => string-—
toHexStringConvert to hex format color string, the return type like: #1677ff() => string-—
toHsbConvert to hsb object() => ({ h: number, s: number, b: number, a: number })-—
toHsbStringConvert to hsb format color string, the return type like: hsb(215, 91%, 100%)() => string-—
toRgbConvert to rgb object() => ({ r: number, g: number, b: number, a: number })-—
toRgbStringConvert to rgb format color string, the return type like: rgb(22, 119, 255)() => string-—