Skip to content
Huey
GitHub

Color Swatch

A clickable color swatch element for selecting preset colors.

import { ColorSwatch } from '@hueycolor/vue'
<script setup>
import { ref } from 'vue'
import { HueyRoot, ColorSwatch, hueyColor } from '@hueycolor/vue'
const color = ref(hueyColor('#1A3263'))
const swatch = ['#007680', '#24B2FF', '#FFBA51', '#FFD013', '#F65600']
</script>
<template>
<HueyRoot v-model="color">
<ColorSwatch :swatch="swatch" />
</HueyRoot>
</template>
Prop Type Default Description
swatch string[] Array of hex color values to display as selectable presets.
aria-label string 'Color swatch' Accessible label for the swatch group.