Back to Element Plus

ColorPickerPanel

docs/en-US/component/color-picker-panel.md

2.13.74.1 KB
Original Source

ColorPickerPanel ^(beta)

ColorPickerPanel is the core component of ColorPicker.

Basic usage

:::demo ColorPickerPanel requires a string typed variable to be bound to v-model.

color-picker-panel/basic

:::

Alpha

:::demo ColorPickerPanel supports alpha channel selecting. To activate alpha selecting, just add the show-alpha attribute.

color-picker-panel/alpha

:::

Predefined colors

:::demo ColorPickerPanel supports predefined color options

color-picker-panel/predefined-color

:::

Border

By default the color-picker-panel is bordered but in some case you don't want it.

:::demo

color-picker-panel/border

:::

Disabled

The disabled attribute determines if the color picker is fully disabled.

:::demo

color-picker-panel/disabled

:::

API

Attributes

NameDescriptionTypeDefault
model-value / v-modelbinding value^[string]
borderwhether the color picker panel is bordered^[boolean]true
disabledwhether to disable the color picker^[boolean]false
show-alphawhether to display the alpha slider^[boolean]false
color-formatcolor format of v-model^[enum]'rgb' | 'prgb' | 'hex' | 'hex3' | 'hex4' | 'hex6' | 'hex8' | 'name' | 'hsl' | 'hsv'^[enum]'hex' (when show-alpha is false) | 'rgb' (when show-alpha is true)
predefinepredefined color options^[array]string[]
validate-event ^(2.11.7)whether to trigger form validation^[boolean]true
hue-slider-class ^(2.13.6)class names will be passed to hue-slider^[object]string | string[] | Record<string, boolean>
hue-slider-style ^(2.13.6)styles will be passed to hue-slider^[string] / ^[object]StyleValue

Slots

NameDescription
footercontent to append after the Input

Exposes

NameDescriptionType
colorcurrent color object^[object]Color
inputRefcustom input ref^[object]InputInstance
update ^(2.11.4)update sub components^[Function]() => void