Color Picker
The trigger opens a popover with a color area, hue strip, hex field, and channel sliders. Edits come back as a lowercase hex string.
Installation
Copy the command below and run it in your terminal.
Usage
Bind value on Root, or pass value with onValueChange. format picks the slider set: hsl (default), rgb, or hsv.
Opening the picker focuses the color area, not the hex field. Arrow keys move the color area and hue strip, and Shift moves them in steps of 10. In browsers that support the EyeDropper API, the pipette button in the hex field picks a color from anywhere on screen.
Examples
Default
Accent color
Channel formats
HSL
RGB
HSV
With preset swatches
Label color
Anatomy
ColorPicker.Root - Controls color picker state.
ColorPicker.Trigger - Opens the color picker.
ColorPicker.Content - Renders color selection controls.
<script lang="ts"> import * as ColorPicker from '@sivir-ui/svelte/components/color-picker'; let color = $state('#5e6ad2'); </script> <ColorPicker.Root value={color} onValueChange={(v) => (color = v)}> <ColorPicker.Trigger /> <ColorPicker.Content /> </ColorPicker.Root>