Color Picker

A color picker allows users to select a color from a palette or input a custom color value.

<ColorPicker>
  <ColorPickerTrigger />
  <ColorPickerContent>
    <ColorEditor />
  </ColorPickerContent>
</ColorPicker>

Installation

npx shadcn@latest add @dotui/color-picker

Usage

Use color pickers to allow users to select a color from a palette or input a custom color value.

import { ColorEditor } from "@/components/ui/color-editor";
import { ColorPicker, ColorPickerContent, ColorPickerTrigger } from "@/components/ui/color-picker";
<ColorPicker defaultValue="#ff0000">
  <ColorPickerTrigger />
  <ColorPickerContent>
    <ColorEditor />
  </ColorPickerContent>
</ColorPicker>

Playground

Use the controls below to experiment with different color picker props and see the live preview and code update.

<ColorPicker defaultValue="#ff0000">
  <ColorPickerTrigger />
  <ColorPickerContent>
    <ColorEditor />
  </ColorPickerContent>
</ColorPicker>

API Reference

ColorPicker

A ColorPicker synchronizes a color value between multiple React Aria color components. It simplifies building color pickers with customizable layouts via composition.

PropType
ReactNode | function
string | Color
string | Color
function

ColorPickerTrigger

Missing description.

PropType
boolean
union
"sm" | "md" | "lg"
"default" | "square" | "auto"
boolean

ColorPickerContent

Missing description.

PropType
ReactNode | function

Last updated on 1/13/2026

Built with passion by @mehdibha.