Skip to content

ColorPicker ​

Used for select and display colors.

Basic usage ​

Color Picker basic usage.

#49629A

Disabled ​

Set disabled to disable the selector.

#49629A

Color format ​

Set the format of the color value through format, supporting hex and rgb.

hex

#49629A

rgb

rgb(73, 98, 154)

Preset & History ​

The preset color and history color areas can be opened through `showPreset` and `showHistory`. Historical colors require users to control the display content themselves.

Trigger ​

set the properties of the trigger through trigger-props.

Customize trigger element ​

Customize trigger element.

#49629A

Size ​

Besides default size, tu-color-picker component provides three additional sizes for you to choose among different scenarios. Use attribute size to set additional sizes with mini, small, large.

#49629A
#49629A
#49629A
#49629A

Only panel ​

Only use the color selection panel.

Hex
#
Preset Colors
Hex
#
Preset Colors

ColorPicker API ​

ColorPicker Attributes ​

NameDescriptionTypeDefault
model-valueValueString-
default-valueDefault value (uncontrolled state)String-
formatColor value formatString-
sizeSizeStringmedium
show-textShow color valueBooleanfalse
show-historyShow history colorsBooleanfalse
show-presetShow preset colorsBooleanfalse
disabledDisabledBooleanfalse
disabled-alphaDisable transparency channelBooleanfalse
hide-triggerThere is no trigger element, only the color panel is displayedBooleanfalse
trigger-propsCan accept Props of all Trigger componentsObject-
history-colorsColor array of historical colorsArray-
preset-colorsColor array of preset colorsArraycolors

ColorPicker Events ​

NameDescriptionType
changeTriggered when the color value changesFunction
popup-visible-changeTriggered when the color panel is expanded and collapsedFunction