Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Color Picker

Preview

Install

Add it with your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/color-picker

Import the shared styles once in your application.

TSUsage
import ColorPicker from '@/components/beui/controls/ColorPicker.vue'
import '@/components/beui/styles.css'

API Reference

ColorPicker

v-model?
string

Controlled hex color (#rgb, #rrggbb or #rrggbbaa).

Default—
defaultValue?
string

Starting color when `v-model` is not bound.

Default#3478f6
@value-commit?
(value: string) => void

Alias of `commit`, named like the upstream `onValueCommit`.

Default—
alpha?
boolean

Allow transparency. When false the value is always opaque.

Defaulttrue
name?
string

Submits the hex value with a form under this name.

Default—
v-model:open?
boolean

Controlled open state for ColorPickerTrigger + ColorPickerContent.

Default—
defaultOpen?
boolean

Starts open when `v-model:open` is not bound.

Defaultfalse
labels?
Partial<ColorPickerMessages>

Override any built-in string.

Default—
class?
string
Default—
label?
string

Accessible name of the trigger and the panel in the ready-made picker.

DefaultColor
presets?
readonly ColorPickerPresetValue[]

Swatches of the ready-made picker.

Default[]
disabled?
boolean
Default—
@commit?
(value: string) => void

Fires once an interaction settles: pointer release, key, preset or field commit.

Default—
#default?
slot

Compose the picker from its parts. Omit it for the ready-made trigger and panel.

Default—

ColorPickerArea

label?
string

Accessible name for the 2D thumb. Default "Saturation and brightness".

Default—
class?
string
Default—

ColorPickerHue

label?
string

Accessible name for the thumb. Default "Hue".

Default—
class?
string
Default—

ColorPickerAlpha

label?
string

Accessible name for the thumb. Default "Opacity".

Default—
class?
string
Default—

ColorPickerSwatch

class?
string
Default—

ColorPickerHexInput

class?
string
Default—

ColorPickerChannels

format?
"rgb" | "hsl"

Which channels to edit. Default "rgb".

Defaultrgb
class?
string
Default—

ColorPickerEyeDropper

class?
string
Default—

ColorPickerPresets

class?
string
Default—
#default?
slot
Default—

ColorPickerPreset

value
string

Any hex color.

Default—
label?
string

Accessible name; selection never relies on color alone.

Default—
class?
string
Default—

ColorPickerTrigger

#default?
slot

Replaces the hex label beside the chip.

Default—
class?
string
Default—

ColorPickerContent

align?
"start" | "end"

Edge of the trigger the panel lines up with.

Defaultstart
class?
string
Default—
#default?
slot
Default—
Also on React Native. A popover picker with a loupe under your finger.(opens in a new tab)

Updated