ColorPicker ​

ColorPicker is a color selector supporting multiple color formats.

Basic usage ​

ColorPicker requires a string typed variable to be bound to v-model.

With default value
With no default value

Alpha ​

ColorPicker supports alpha channel selecting. To activate alpha selecting, just add the show-alpha attribute.

Predefined colors ​

ColorPicker supports predefined color options

Sizes ​

API ​

Attributes ​

NameDescriptionTypeDefault
model-value / v-modelbinding valuestring—
disabledwhether to disable the ColorPickerbooleanfalse
clearable 2.13.1whether to show clear buttonbooleantrue
sizesize of ColorPickerenum—
show-alphawhether to display the alpha sliderbooleanfalse
color-formatcolor format of v-modelenumenum
popper-classcustom class name for ColorPicker's dropdownstring / object''
popper-style 2.11.4custom style for ColorPicker's dropdownstring / object—
predefinepredefined color optionsarray—
validate-eventwhether to trigger form validationbooleantrue
tabindexColorPicker tabindexstring / number0
aria-label a11y 2.7.2ColorPicker aria-labelstring—
empty-values 2.10.3empty values of component, see config-providerarray—
value-on-clear 2.10.3clear return value, see config-providerstring / number / boolean / Function—
idColorPicker idstring—
teleported 2.7.2whether color-picker popper is teleported to the bodybooleantrue
label a11y deprecatedColorPicker aria-labelstring—
persistent 2.10.5when color-picker inactive and persistent is false, the color panel will be destroyedbooleantrue
append-to 2.10.5which element the color-picker panel appends toCSSSelector / HTMLElement-

Events ​

NameDescriptionType
changetriggers when input value changesFunction
active-changetriggers when the current active color changesFunction
focus 2.4.0triggers when Component focusesFunction
blur 2.4.0triggers when Component blursFunction
clear 2.13.1triggers when the clear button is clickedFunction

Exposes ​

NameDescriptionType
colorcurrent color objectobject
show 2.3.3manually show ColorPickerFunction
hide 2.3.3manually hide ColorPickerFunction
focus 2.3.13focus the picker elementFunction
blur 2.3.13blur the picker elementFunction

Source ​

Component • Style • Docs

Contributors ​