Color picker
VerifiedSwatches to choose from and a hex field for any other color.
When to use
- Use when
- Choosing a color from a few swatches or by hex value.
- Avoid when
- Picking from gradients or an image; this has no canvas.
Installation
The source lands in src/components/ui/color-picker.tsx, along with any Shelf items it builds on, and .shelf/lock.json records what was installed. It's yours to edit.
Usage
Built on
- Packages
@base-ui/react,@stylexjs/stylex- Accessibility
- Focus, keyboard, and ARIA behavior come from Base UI.
- Figma
- Optional native Figma library. See Designers.
Verified
- Size
- 1.9 kB gzipped on its own, 17 kB with the Shelf items and packages it builds on. JS and CSS in a production build, without React.
- Accessibility
- Axe passes on 3 stories
- Behavior
- 3 interaction tests in Storybook
- React Doctor
- React Doctor finds nothing