Skip to content
Calm motion: animations on this site only fade, with no movement

ColorPicker ​

Native color input + swatches

The platform's color picker in a square plate: click the well and the OS dialog opens. The library only frames it. The model is what <input type="color"> gives: a lowercase #rrggbb, no alpha (a platform limit). showValue prints the hex beside the well as an <output>. swatches add one-click presets, drawn by BlessColorSwatches as a radio group, so the arrow keys move between them. Pass { value, label } so a screen reader hears a name, such as "Pink", and not a hex code.

Inside a BlessField the field's label names the input. label is for a picker with no visible label.

Basic
#e85078

Usage ​

ts
import { BlessColorPicker } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
idstring—
swatches(string | { value: string; label: string; })[][]preset swatches: hex, or { value, label } so a screen reader hears a name, not a hex
disabledboolean—
labelstring—accessible name when there is no visible label (a BlessField's label is used otherwise)
showValuebooleantrueshow the hex next to the well
modelValuestring"#e85078"

Events

NamePayloadDescription
update:modelValue[value: string]

Released under the MIT License. Character names and artwork belong to their owners.