Color Picker

A color picker component that supports visual selection, hex input, and preset swatches.

Install

npx @vultra/cli add color-picker

Usage

<script>
  import { ColorPicker } from '@vultra/ui';

  let color = $state('#6366f1');
</script>

<ColorPicker bind:value={color} />
<p>Selected: {color}</p>

Props

PropTypeDefaultDescription
valuestring‘#000000’Current color value (hex)
showInputbooleantrueShow hex input field
showSwatchesbooleanfalseShow preset color swatches
swatchesstring[][]Preset color hex values
disabledbooleanfalseDisable interaction
classstring-Additional CSS classes

Events

EventDetailDescription
changestringFires when color changes

Notes

  • Accepts and emits hex color values.
  • Supports RGB and HSL internally for smooth selection.