Powerful and customizable React color picker components built for modern applications and websites. These color pickers are built using React Aria and styled with Tailwind CSS.
Installation
You can add this color picker component using our CLI or manually:
npx untitledui@latest add color-picker
Color picker examples
Below are examples and variations of this color picker component:
Color swatch picker
The color swatch picker provides a grid-based color selection experience with a preview area and a hex input field. This is useful when you want users to quickly pick from a predefined set of colors.
Brand swatches
Brand color swatches provide a curated palette of your brand colors based on Tailwind CSS v4.3 color variables. This is useful for design systems where users need to pick from a consistent set of brand colors.
Brand
Tailwind CSS v4.3
Gray
Tailwind CSS v4.3
Minimal picker
The minimal picker provides a compact color selection experience with just the eye dropper, hue slider, alpha slider, and color format input. This is ideal for space-constrained UIs where you need basic color picking functionality.
Hue slider
The standalone hue slider allows users to select a hue value across the full color spectrum. It displays a swatch preview of the selected color alongside the slider.
Transparency slider
The standalone transparency (alpha) slider allows users to control the opacity of a selected color. It displays a checkered background to visualize the transparency level.
Palette picker
The palette picker displays the full Tailwind CSS color palette in a grid layout, allowing users to select from a comprehensive range of colors. It also includes an opacity slider for fine-tuning the selected color.
Opacity
Saved
API reference
Import the parts and assemble them:
import { ColorPicker } from "@/components/application/color-picker/color-picker"; <ColorPicker.Dialog> <ColorPicker.Provider> <ColorPicker.Area /> <ColorPicker.EyeDropper /> <ColorPicker.HueSlider /> <ColorPicker.AlphaSlider /> <ColorPicker.ColorFormatSelect /> <ColorPicker.ColorValueInput /> <ColorPicker.SavedColors /> </ColorPicker.Provider> </ColorPicker.Dialog>
ColorPicker
Renders a <div> element.
ColorPicker.AlphaSlider
Renders React Aria’s ColorSlider — all of its props are supported.
Styling (5)
Accessibility (4)
Also accepts all standard React DOM event handlers, the global HTML attributes (dir, lang, hidden, inert, translate).
ColorPicker.Area
Renders React Aria’s ColorArea — all of its props are supported.
Styling (5)
Accessibility (4)
Also accepts the global HTML attributes (dir, lang, hidden, inert, translate), all standard React DOM event handlers.
ColorPicker.ColorFormatSelect
Renders Select.
Props from React Aria (38)
Also accepts all standard React DOM event handlers, the global HTML attributes (dir, lang, hidden, inert, translate).
ColorPicker.ColorValueInput
ColorPicker.Dialog
Renders a <div> element.
ColorPicker.EyeDropper
Renders Button.
Props from React Aria (41)
Also accepts the global HTML attributes (dir, lang, hidden, inert, translate), all standard React DOM event handlers.
ColorPicker.HueSlider
Renders React Aria’s ColorSlider — all of its props are supported.
Styling (5)
Accessibility (4)
Also accepts all standard React DOM event handlers, the global HTML attributes (dir, lang, hidden, inert, translate).
ColorPicker.Provider
Import Provider from @/components/application/color-picker/color-picker-context. Renders React Aria’s ColorPicker — all of its props are supported.
ColorPicker.SavedColors
Renders a <div> element.
ColorPicker.SwatchItem
Renders React Aria’s ColorSwatchPickerItem — all of its props are supported.
Props from React Aria (15)
Also accepts the global HTML attributes (dir, lang, hidden, inert, translate), all standard React DOM event handlers.
InputCell
Renders a <div> element.
FAQs
Please refer to our frequently asked questions page for more.
The format select offers five formats: "hex", "rgb", "css" (an rgba() string), "hsl" and "hsb". Set the starting format with defaultColorFormat on ColorPicker.Provider; it defaults to "hex".
Yes. ColorPicker.EyeDropper opens the browser's EyeDropper API and sets the color the user picks. In browsers without the API the button renders nothing, so you don't need to feature-detect it yourself.
Yes. The all-in-one ColorPicker and parts such as ColorPicker.EyeDropper, ColorPicker.ColorFormatSelect and ColorPicker.ColorValueInput read their state from ColorPicker.Provider, and useColorPicker() throws outside one. ColorPicker.Dialog is only the card container, so place the provider inside it.
Pass value and onChange to ColorPicker.Provider for a controlled picker, or defaultValue (which defaults to "#7F56D9") for an uncontrolled one. Both accept a CSS color string or a React Aria Color. onChange receives a Color object, so call color.toString("hex") when you need a string.
Yes. Inside ColorPicker.Provider, arrange ColorPicker.Area, ColorPicker.HueSlider, ColorPicker.AlphaSlider, ColorPicker.EyeDropper, ColorPicker.ColorFormatSelect and ColorPicker.ColorValueInput however you like. Your own components can read and change the color with the useColorPicker() hook, which returns { state, actions }.
Render ColorPicker.SavedColors with a colors array of CSS color strings. onSelect receives the clicked swatch as a hex string, and passing onAdd shows an Add button (omit it to hide the button). The heading defaults to "Saved" and can be changed with label.