vanilla-picker

vanilla-picker.js.org ↗

Attach a dependency-free colour popup to a page element.

SI Score
80/100
Pricing
Open Source AI reading, not confirmed
Free plan
Yes AI reading, not confirmed
Sign-up required
Not confirmed

Ask SI about vanilla-picker

Answers use saved listing facts and recorded sources.
Homepage screenshot
Screenshot of the vanilla-picker homepage

What it does

vanilla-picker is an ISC-licensed JavaScript colour popup with alpha selection. Its separate live-change and confirmation callbacks support an editor that previews a choice before committing it.

Attach the picker to a parent element, choose the starting colour and set its position. A popup can sit on any side of the parent; disabling popup mode embeds it as a normal child. The text editor can show HEX, HSL or RGB while still accepting other supported input forms.

Use onChange for a preview and onDone for the OK action. A silent setColor update can restore an application value without firing another change callback. Returned values include CSS strings and numerical arrays.

The default build inserts its CSS through a style element. Where a content-security policy prevents that, the documented CSP build uses a separately linked stylesheet. The open-source package has no runtime dependencies.

Strengths

  • Live preview and confirmed selection have separate callbacks.
  • The same component supports popup and embedded layouts.
  • A separate build accommodates restrictions on injected styles.

Watch out for

  • The default stylesheet injection may conflict with a strict content-security policy.

Best for

  • Small browser editors with colour previews and an OK action

Sources