Skip to content

ColorPicker ​

Native colour input + swatches

The platform's colour 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 with a pressed state — pass { value, label } so a screen reader hears "Megumi" rather than a hex.

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.