Skip to content

ColorPicker

Popover color picker. Click the trigger button to open a full-featured color panel, with adaptive positioning powered by Floating UI.

Basic Usage

vue
<TColorPicker v-model="color" />

Hide Value

vue
<TColorPicker v-model="color" :show-value="false" />

With Label

vue
<TColorPicker v-model="color" label="Theme color" />

Output Format

vue
<TColorPicker v-model="color" color-format="rgb" />

Alpha Support

vue
<TColorPicker v-model="color" show-alpha />

Predefined Colors

vue
<TColorPicker v-model="color" :predefine="['#f00', '#ff0', '#0f0']" />

Sizes

vue
<TColorPicker v-model="color" size="sm" />
<TColorPicker v-model="color" size="md" />
<TColorPicker v-model="color" size="lg" />

Disabled

vue
<TColorPicker v-model="color" disabled />

API

Props

PropTypeDefaultDescription
v-modelstring'#066fd1'Color value
color-format'hex' | '#hex' | 'rgb' | 'hsv' | 'hsl''#hex'Output format
show-alphabooleanfalseShow alpha slider
show-valuebooleantrueShow color value text
predefinestring[]Predefined color swatches
disabledbooleanfalseDisabled state
labelstringLabel text
size'sm' | 'md''md'Trigger button size

Emits

EventDescriptionCallback
update:modelValuev-model update(value: string)
changeColor changed(value: string)