A hex color picker with optional preset swatches.
Copy the command below and run it in your terminal.
bunx @sivir/ui add color-picker
pnpm dlx @sivir/ui add color-picker
npx @sivir/ui add color-picker
yarn dlx @sivir/ui add color-picker
Compose the Color Picker from its Root, Trigger, and Content parts:
Root
Trigger
Content
import * as ColorPicker from '$lib/sivir/components/color-picker'; let value = $state('#5e6ad2'); <ColorPicker.Root value={value} onValueChange={(v) => (value = v)}> <ColorPicker.Trigger /> <ColorPicker.Content /> </ColorPicker.Root>
Pick a color
Choose