What it does
Install the chroma-panel package with npm, pnpm, yarn or bun. Use the picker as a form input, or place the panel on the page. Wheel mode picks hue around the wheel and saturation from the center. Classic mode sets saturation and brightness in one square, then adjusts hue. Harmony mode finds complementary, analogous, triadic and tetradic colors. Value mode accepts exact hue, saturation, brightness, RGB and opacity values. Palettes mode searches the built-in palettes or accepts your own brand colors. The React guide builds a controlled picker with useState and saves the value when the user is done.
Capabilities
- Image mode lets users upload, drop or paste an image, extract its palette and sample one pixel.
- The gradient editor builds linear and radial gradients with color stops that can be moved from the keyboard.
- CSS color utilities parse, convert and format hex, RGB, HSL, OKLCH, Lab and Display P3 colors.
- The shadcn/ui guide maps the picker to shadcn/ui tokens and opens it from your own popover.
- The Material UI guide places the panel inside an MUI Popover without nesting two popups.
When to use it
- You need a color picker that works as a form input in a React application.
- You want to place a color picker panel directly on the page.
- You want a color picker that fits into a shadcn/ui popover or a Material UI Popover.