DDS/Components/ColorPicker

ColorPicker

Form

A color selection component with swatches and a hex input. Triggers the native color picker on click.

Props

PropTypeDefaultDescription
modelValuestring"#7f00ff"Selected hex color (v-model).
swatchesstring[]16 default colorsArray of hex color strings.
showInputbooleantrueShow the hex input + native picker.
disabledbooleanfalseDisables all interactions.

Examples

Swatches + hex input
vue
<script setup>
const color = ref('#7f00ff')
</script>
<template>
  <DsColorPicker v-model="color" :show-input="true" />
</template>
Swatches only
vue
<script setup>
const color = ref('#7f00ff')
</script>
<template>
  <DsColorPicker v-model="color" :show-input="true" />
</template>

Skeleton

Use DsColorPickerSkeleton as a loading placeholder while content is being fetched.

Default
vue
<DsColorPickerSkeleton />

Accessibility

  • Swatches have aria-pressed state.
  • Native color input is visually hidden but accessible.
  • Title attribute shows hex value.