Skip to content

ColorPicker

ColorPicker is a color selection input with a swatch trigger, native color wheel, hex text input, and optional preset swatches.

Basic usage

Value: #2563eb

Tailwind v4
vue
<script setup>
import { ref } from 'vue'
const color = ref('#2563eb')
</script>

<ColorPicker v-model="color" label="Brand color" />

With presets

Tailwind v4
vue
<ColorPicker
  v-model="color"
  label="Theme color"
  :presets="['#ef4444', '#22c55e', '#2563eb', '#7c3aed']"
/>

Without hex input

Tailwind v4
vue
<ColorPicker v-model="color" :show-input="false" />

Disabled

Tailwind v4
vue
<ColorPicker v-model="color" :disabled="true" />

Props

PropTypeDefaultDescription
modelValuestringHex color value e.g. #FF5733 (use with v-model)
disabledbooleanfalseDisables the picker
labelstringLabel shown above the swatch
showInputbooleantrueShow hex text input alongside the swatch
presetsstring[][]Array of preset hex colors shown as swatches in the popover

Events

EventPayloadDescription
update:modelValuestringEmitted when a color is selected or the hex input changes to a valid hex

Private — Jetpack Labs internal use only