Colors

Color Picker

A versatile UI component that provides multiple ways to choose colors, including sliders, swatches, and manual input.

Basic

The basic color picker allows users to select a color.

Loading...

Installation

npx shadcn@latest add @intentui/color-picker

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

This component comes packed with several components to enhance functionality and provide a seamless experience.

Manual installation

npm i react-aria-components @intentui/icons

Anatomy

import { ColorPicker } from "@/components/ui/color-picker"

<ColorPicker
  label="Theme Color"
  description="Snag a color for the app theme"
  defaultValue="hsl(216, 98%, 52%)"
/>

Enable format selection

Enable users to select the format of the color value (e.g., RGB, HSL).

Loading...

Combination

Combine both swatch and selection format options in the color picker.

Loading...

Eye dropper

Add an eye dropper button to the color picker to allow users to select a color from the screen.

Loading...

Label

Add a label to the color picker for better accessibility and user guidance.

Loading...

Dynamic label

Dynamically update the label based on the selected color.

import { ColorPicker, defaultColor } from "@/components/ui/ui"

const [color, setColor] = useState(defaultColor)
return <ColorPicker label={color.toString('hex')} value={color} onChange={setColor} />

Description

Include a description to provide additional information or instructions.

Loading...

Controlled

Control the selected color with the value prop to sync it with your application's state.

Loading...

Disabled

Disable the color picker by setting the isDisabled prop, making it non-interactive.

Loading...
Unlock the full power of
Design Intent UI
Build modern web apps faster with 350+ blocks and polished templates crafted for professionals.
Explore