Pickr: a single-file color picker with a frozen feature set
🎨 Pickr - A simple, multi-themed, responsive and hackable Color-Picker library. No dependencies, no jQuery. Compatible with all CSS Frameworks e.g. Bootstrap, Materialize. Supports alpha channel, rgba, hsla, hsva and more!
At a glance
- What is it?
- Pickr is a dependency-free JavaScript color picker that mounts into a selector, ships three CSS themes and reports every change as an HSVa object. Its own project page calls the feature set frozen and points readers at building the widget inside their framework instead.
- Who is it for?
- Pickr still installs from npm and hands you three themes, opacity control, swatches and nine events, which covers a plain color field on a modern browser. Pass on it if you need an es5 artifact, a feature roadmap, or a widget that shares state with a component framework.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 3 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- simonwep/pickr4,494 ★ · +5
| Repository | 2026-09-23 | 2026-11-15 |
|---|---|---|
| simonwep/pickr | 4.5k | 4.5k |
5 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
A single-file core with a frozen feature set
Pickr is built the way its own project page says it is: monolithic, with the core in one single file and everything in plain JS. The author says that shape makes it hard to maintain, and that tests become impossible at this stage without a complete rewrite. Security and bug related updates may still land, but the feature set is frozen and new features are ruled out. That is the fact that should drive the decision, because it changes how the library gets shipped rather than how it feels to use. Nothing travels at runtime to absorb a browser gap, and nothing new is coming to close one.
The release line is still moving. v1.10.0 was published on 2026-07-18, v1.10.1 on 2026-07-29 and v1.10.2 on 2026-09-08, and the last push carries the same 2026-09-08 date. The same page points at preact, vue and svelte and argues that building this kind of widget inside the framework you already use takes more time while handing you full control over behaviour and appearance. For anything with a long maintenance horizon, that is the trade to weigh before you add the dependency.
The es5 build is gone and Nano needs css-grid
A warning near the top of the project page says that as of `v1.10.0` there is no `es5` version anymore, and that anyone who needs to support older browsers should consult the docs for their bundler to transpile dependencies. The manifest agrees. There is no legacy field, `type` is set to `module`, and the exports map offers only `import`, `require` and `types`.
There is a second floor underneath that one. Nano is built on css-grid, and the page says plainly that it will not work in older browsers, so reaching for Nano narrows the browser floor further than Classic or Monolith does. The consequence is that this decision lands before install instead of at runtime: either bring a bundler that transpiles dependencies, or accept the floor the published files already imply. The theme choice and the transpilation step are two separate commitments made up front.
npm install, then a theme import Pickr cannot do for you
Two package managers, one package name:
$ npm install @simonwep/pickr
$ yarn add @simonwep/pickrAfter install you still have to name a theme yourself. The JavaScript entry point injects no CSS, so importing the package on its own leaves an unstyled panel. The documented pattern pairs one theme stylesheet with the module, then creates the instance against a selector that must already exist in your markup, because the `el` option replaces whatever element it matches:
import '@simonwep/pickr/dist/themes/classic.min.css';
import Pickr from '@simonwep/pickr';
const pickr = Pickr.create({
el: '.color-picker',
theme: 'classic',
});Three entry points back that up. `main` resolves to `./dist/pickr.min.js`, `module` to `./dist/pickr.min.mjs`, and `types` to `./types/pickr.d.ts`. The exports map forwards `./dist/themes/*` untouched and points the bare specifier at the ESM build for imports, the CommonJS build for requires, and the declaration file for types. The published `files` array is `types`, `dist` and `src/scss`, so the Sass sources ride along with the package even though no command for compiling them is given.
The stylesheet must load first and defer does not work
Browser use goes through jsdelivr, and the order of the two tags is not a detail. The page gives two rules directly: load `pickr.min.js` after `pickr.min.css`, and do not put `defer` on the script tag.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/themes/classic.min.css"/>
<script src="https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/pickr.min.mjs" type="module"></script>That rules out a pattern most pages reach for by habit. A script tag carrying `defer` will not do what the page asks, so deferring every script at the bottom of the document is off the table for this picker, and the alternative is handing the module to a bundler rather than a CDN. The same applies to themes. Exactly one of the three stylesheets is meant to be linked, and linking two puts two sets of rules on the same panel. Since no CSS is bundled into the JavaScript, the order of those lines in the template is the entire mechanism, and no configuration key repairs a wrong order.
closeOnScroll dismisses the picker instead of following the page
The options object decides where the picker lives and what happens when the page moves under it. Two entries matter most. `container` sets where the picker app is added as a child, and the documented example passes `'body'`, so the panel attaches to the document rather than to the element named by `el`. A separate example on the same page shows selection through a Shadow-DOM. `closeOnScroll` defaults to `false`, and the page is direct about why:
const pickr = new Pickr({
el: '.color-picker',
container: 'body',
theme: 'classic',
closeOnScroll: false,
});Nested scrolling is not supported, adding it would be sophisticated work, and setting the flag to `true` hides pickr if the user scrolls the area behind it. So a color field sitting inside its own scrollable panel gets a blunt failure mode: open the palette, scroll the panel underneath, and the picker is dismissed rather than carried along.
Nine events, and every color arrives as HSVa
Pickr has been event-driven since version `0.4.x`, and every listener is bound with `on(event, cb)` and released with `off(event, cb)`. The full list is short enough to read in one go, and the argument column is where the design shows: no CSS string appears anywhere in it.
| Event | Description | Arguments | | -------------- | ----------- | --------- | | `init` | Initialization done - pickr can be used | `PickrInstance` | | `hide` | Pickr got closed | `PickrInstance` | | `show` | Pickr got opened | `HSVaColorObject, PickrInstance` | | `save` | User clicked the save / clear button. Also fired on clear with `null` as color. | `HSVaColorObject or null, PickrInstance` | | `clear` | User cleared the color. | `PickrInstance` | | `change` | Color has changed (but not saved). Also fired on `swatchselect` | `HSVaColorObject, eventSource, PickrInstance` | | `changestop` | User stopped to change the color | `eventSource, PickrInstance` | | `cancel` | User clicked the cancel button (return to previous color). | `PickrInstance` | | `swatchselect` | User clicked one of the swatches | `HSVaColorObject, PickrInstance` |
Three rows carry the sharp edges. `save` hands over `null` on a clear, so a handler that reads the color without a null check fails on that path. `change` fires on `swatchselect` too, meaning one swatch click produces two events. And `change` carries an `eventSource` limited to three values, `slider`, `input` and `swatch`, which is also the value passed to `changestop`.
pickr.on('init', instance => {
console.log('Event: "init"', instance);
}).on('save', (color, instance) => {
console.log('Event: "save"', color, instance);
});Colors arrive as an `HSVaColorObject`, so the rgba and hsla forms named in the package description are conversions you perform rather than values handed to you.
A pnpm and vite workspace with no runtime dependencies
The repository is a pnpm and vite workspace, not a bare library folder. The top level holds `build/`, `src/`, `types/`, `www/`, `index.html`, `EXAMPLES.md`, `eslint.config.js`, `.editorconfig`, `pnpm-lock.yaml` and `pnpm-workspace.yaml`, and the manifest pins `packageManager` to `[email protected]`. Two entries do the real work:
vite --config build/demo.config.ts
vite build --config build/lib.config.ts && node build/themes.jsThe first is the `dev` script, which serves the demo from `build/demo.config.ts`. The second is `build:lib`, which builds the library and then runs `node build/themes.js`, the step that produces the three theme stylesheets the package ships. Everything in `devDependencies` is build-time only: `vite` 8.1.5, `sass` 1.101.0, `nanopop` 2.4.2, `eslint` 10.10.0, `@eslint/js` 10.0.1, `globals` 17.12.0, `@types/node` 24.13.3 and `vite-plugin-banner` 0.8.1. There is no `dependencies` block at all, which is the plainest form of the zero dependency claim: `nanopop` handles positioning inside the bundle and nothing else reaches your users. `EXAMPLES.md` collects further usage patterns, and `index.html` with `www/` is the demo the project page links to.
Editorial conclusion
Pickr still installs from npm and hands you three themes, opacity control, swatches and nine events, which covers a plain color field on a modern browser. Pass on it if you need an es5 artifact, a feature roadmap, or a widget that shares state with a component framework. Pin one exact version before shipping, since only security and bug fixes are planned and no test suite is coming.
Frequently asked questions
Does Pickr still ship an es5 build for older browsers?
No. As of v1.10.0 there is no es5 version anymore, and the project page directs anyone who needs older browser support to transpile dependencies through their bundler.
Which Pickr theme is the safe one when old browsers are in scope?
Nano is the one flagged. Nano uses css-grid, and the page states that it will not work in older browsers. Classic and Monolith are listed as the other two themes and carry no such note.
Why does my Pickr script tag stop working when I add defer?
The page gives two hard conditions: load pickr.min.js after pickr.min.css, and do not put defer on the script tag. Both are stated directly, so a deferred tag simply falls outside what the documented setup supports.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/simonwep-pickr)Star history chart for your README
[](https://hysenlabs.com/projects/simonwep-pickr)Was this useful?