NewYour coding agent can read the release notes before it upgrades.Set up the MCP server β
npm
npm, #4220 most downloaded on npm
π¨ A tiny (3,1 KB) color picker component for React and Preact apps. Fast, well-tested, dependency-free, mobile-friendly and accessible
Latest stable
5.8.1
Last release 2 months ago
01 Sep 2026
Ships unpredictably
gaps range from 2 weeks to 3.7 years
Nearly every release is documented
notes for 59 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
74 releases Β· first in 2020
Drag across the ruler to compare, or tap a release to open it.
Fix RGB channels drifting when only the alpha channel is changed: { r: 200, g: 120, b: 35 } no longer becomes { r: 199, g: 119, b: 34 } after moving t
{ r: 200, g: 120, b: 35 } no longer becomes { r: 199, g: 119, b: 34 } after moving the alpha slider. Thanks to @t-hamano for the investigation (via #234, fixes #163)The picker now works inside Shadow DOM. When mounted inside a shadow tree, the component injects its styles into the closest ShadowRoot instead of the
The picker now works inside Shadow DOM. When mounted inside a shadow tree, the component injects its styles into the closest ShadowRoot instead of the document <head>, so it renders correctly in web components and other shadow-DOM-based setups. No API changes required β it just works. (via #232)
ShadowRoot when rendered inside one (via #232)Your coding agent can read these notes before it upgrades. Set up the MCP server β
Added onChangeEnd callback that fires when the user finishes changing a color (on mouse up, touch end, or arrow key up). Useful for undo/redo, saving
Added onChangeEnd callback that fires when the user finishes changing a color (on mouse up, touch end, or arrow key up). Useful for undo/redo, saving to a database, or other expensive operations. (via #230)
<HexColorPicker
color={color}
onChange={setColor}
onChangeEnd={(color) => saveToDatabase(color)}
/>
Added onChangeEnd callback that fires when the user finishes changing a color (on mouse up, touch end, or arrow key up). Useful for undo/redo, saving to a database, or other expensive operations. (via #230)
<HexColorPicker
color={color}
onChange={setColor}
onChangeEnd={(color) => saveToDatabase(color)}
/>Fix React 19 TypeScript compatibility (via #229)
Fix React 19 TypeScript compatibility (via #229)
Update export settings to fix Jet 28 issues (via #191)
Add new HexAlphaColorPicker component (via #186)
HexAlphaColorPicker component (via #186)Fix embedding into . The component is rendered correctly by libraries like react-frame-component. Thanks to @leoc4e (via #166)
<iframe>. The component is rendered correctly by libraries like react-frame-component. Thanks to @leoc4e (via #166)βοΈ Multitouch support! Thanks to @xnimorz (via #158)
βοΈ Multitouch support! Thanks to @xnimorz (via #158)
Add new alpha property for HexColorInput to allow "#rgba" and "#rrggbbaa" formats (via #155)
alpha property for HexColorInput to allow "#rgba" and "#rrggbbaa" formats (via #155)Fix potential memory leaks and improve the performance. Thanks to @xnimorz (via #151)
Add new prefixed property for HexColorInput to display "#" prefix (via #146)
prefixed property for HexColorInput to display "#" prefix (via #146)Fix: Make the picker take focus on click (via #143)
Fix "Unable to preventDefault inside passive event listener" (via #141)
Fix rounded corner rendering bug (via #140)
Improve input color parsers to support valid CSS color notations and units of RGB[A] and HSL[A] color models:
Improve input color parsers to support valid CSS color notations and units of RGB[A] and HSL[A] color models:
// Percentage syntax
"rgb(100% 50% 25%)"
// Valid angular units ("deg", "grad", "rad" and "turn")
"hsl(100grad, 50%, 50%)"
"hsl(0.25turn, 50%, 50%)"
// Modern space and slash separated syntax
"rgba(100% 50% 25% / 99%)"
"hsla(90 50% 50% / 10%)"
// Optional leading zero
"rgb(.99% .1% .5% / .6%)"
"hsla(.2rad, .99%, .5%, .25)"
Made by @omgovich (via #133)
Fix .mjs file publishing (via #129)
.mjs file publishing (via #129)Export .mjs file to improve different environments and bundlers support. Thanks to @rschristian (via #127)
.mjs file to improve different environments and bundlers support. Thanks to @rschristian (via #127)Add "default" fallback to the exports map (via #124)
"default" fallback to the exports map (via #124)Fix setNonce type declaration file publishing (via #123)
setNonce type declaration file publishing (via #123)The picker complies with the strict CSP (Content Security Policy). The style tag added by the component uses a nonce hash provided by Webpack or the o
style tag added by the component uses a nonce hash provided by Webpack or the one defined manually by the new setNonce function (via #121)The picker supports all HTML attributes and DOM events that a regular tag does (e.g. id or onMouseEnter (via #119)
id or onMouseEnter (via #119)Since v5 no longer requires importing CSS separately, the usage of the react-colorful became much simpler.
Since v5 no longer requires importing CSS separately, the usage of the react-colorful became much simpler.
import { HexColorPicker } from "react-colorful";
- import "react-colorful/dist/index.css";
Now the component does not require any CSS loader and can be used with any CSS-in-JS project or component library. Also, by dropping the CSS export we made the library 100% side-effects-free.
The default styles are set to a higher priority level now, so you may need to tweak your styles a bit to override the built-in styles.
Made by @omgovich (via #101)
Fix bug when a user releases the mouse button outside of the document bounds (via #99)
Get rid of useLayoutEffect warning when using on the server (via #95)
useLayoutEffect warning when using on the server (via #95)Fix CSS loading in Webpack v5 (via #91)
Disable static class names minification (via #86)
Migrate from CSS modules to static class names (via #84)
Better React 17 support (via #80)
- Round output values (via #77)
Fix pointer rendering bug on Safari 14 (via #74)
Do not display the default focus styles
- 100% code coverage
Better Internet Explorer 11 support (via #65)
Our color picker now follows the WAI-ARIA guidelines to support users of assistive technologies.
Tab button and change the color with the arrow keys.Made by @omgovich (via #63)
- Simplify gradient CSS styles
Improve pasting from clipboard to HexColorInput
HexColorInputFix: Fast Tap and Release in iOS Safari (via #56)
HsvStringColorPicker and HsvaStringColorPicker components. Thanks to @rschristian (via #48)Resolving TouchEvent error on Firefox. Thanks to @rschristian (via #53)
TouchEvent error on Firefox. Thanks to @rschristian (via #53)Improve Interactive internal typing (via #50)
Interactive internal typing (via #50)Allow to pass custom onBlur callback to HexInput (via #49)
onBlur callback to HexInput (via #49)HexColorInput types (via #49)- Add alpha picker demos
Additional components to work with RGBA, HSLA, HSVA color models. Made by @omgovich (via #47)
<img src="https://user-images.githubusercontent.com/206567/93092604-5210e900-f6a8-11ea-8cea-7c7e9f5e5983.png" width="205" alt="Alpha Color Picker"/>
Additional components to work with RGBA, HSLA, HSVA color models. Made by @omgovich (via #47)
Improve TypeScript tooling. Thanks to @rschristian (via #45)
Fix sideEffects to keep CSS-files
sideEffects to keep CSS-filesNothing published for this version
Nothing published for this version
Extend allowed HexInput props with HTMLInputElement
HexInput props with HTMLInputElementThe entire codebase was rewritten in TypeScript by @rschristian β€οΈ (via #23)
Nothing published for this version
Fix type definitions: make all of the picker props optional
TypeScript types are now bundled with the library. Thanks to @rschristian (via #22)
Make the pointer grabbable even if it is outside of the picket bounds (via #21)
Nothing published for this version
Fix bug if user taps on the picker and does not move the pointer afterward
New HexInput component that allows to paste and type a HEX color (via #18)
HexInput component that allows to paste and type a HEX color (via #18)Reduce the number of folders published to NPM
Interactive to make the bundle lighterFix HSV to RGB conversion algorithm
- Update docs and tooling
Additional color models (input/output formats) support (via #11):
Additional color models (input/output formats) support (via #11):
| Name | Value example |
|---|---|
| RGB | { r: 255, g: 255, b: 255 } |
| RGB String | "rgb(255, 255, 255)" |
| HSL | { h: 0, s: 0, l: 100 } |
| HSL String | "hsl(0, 0%, 100%)" |
| HSV | { h: 0, s: 0, v: 100 } |
Nothing published for this version
One column per quarter.