Color Picker
Saturation area, hue and alpha sliders, hex input, palette swatches.
unreleased@magic-spells/color-picker
Not on the registry yet — clone or read it on GitHub.
Usage
<color-picker name="brand-color" value="#3b82f6"> <color-picker-trigger> <color-swatch data-content-preview></color-swatch> <span>Brand color</span> </color-picker-trigger> <color-picker-panel> <!-- picker controls are generated automatically --> <color-swatch-group> <color-swatch-label>Brand</color-swatch-label> <color-swatch value="#0ea5e9"></color-swatch> <color-swatch value="#8b5cf6"></color-swatch> <color-swatch value="#f59e0b80"></color-swatch> </color-swatch-group> </color-picker-panel> </color-picker>
About
A lightweight, accessible color picker popover web component. Saturation/value area with a draggable selector, hue and alpha sliders, an editable hex input, optional palette swatch groups, and Cancel/Save buttons. On small screens the panel becomes a bottom panel with a backdrop. Zero dependencies, no Shadow DOM.
Attributes
| Attribute | Default | Description |
|---|---|---|
| value | — | Committed hex color (#rrggbb or #rrggbbaa) |
| name | — | Creates a hidden input for form submission |
| disabled | — | Blocks the panel from showing |
| position | auto | Force panel direction: up or down |
| mobile-breakpoint | 480 | Viewport width (px) below which the bottom panel is used |
About, features, usage and options are taken from the package README.