Skip to content

Color Preview

Displays the currently selected color value.

import { ColorPreview } from '@hueycolor/vue'
<script setup>
import { ref } from 'vue'
import { HueyRoot, ColorPreview, hueyColor } from '@hueycolor/vue'
const color = ref(hueyColor('#1A326380'))
</script>
<template>
<HueyRoot v-model="color">
<ColorPreview />
</HueyRoot>
</template>
Prop Type Default Description
splitPreview boolean true Shows a split view of the transparent and opaque color.

Target with [huey-preview]. Use the data-split-view attribute to style each mode:

  • [huey-preview][data-split-view="true"] - split mode
  • [huey-preview][data-split-view="false"] - solid mode
PropertyDefaultDescription
--huey-preview-tile-size 20px Drives both width and height of the preview, plus the size of the transparency checkerboard tiles

The preview’s background color is set dynamically.