Skip to content

Color Picker

Form

Visual color selection input with hue/saturation controls and hex value entry.

Color popoverBrand presetsDisabled
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Store a six-digit hexadecimal color including the # prefix. Supply brand presets, or pass an empty array to hide preset swatches. Use semantic tokens for the surrounding interface.

Import
import { ColorPicker } from "@dashboardpack/core/components/ui/color-picker";

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

Color Picker props
PropType / DefaultDescription
valuestring

Default: required

Current #rrggbb color.
onChange(color: string) => void

Default: required

Receives the next color.
presetsstring[]

Default: 10 standard colors

Preset hex swatches.
disabledboolean

Default: false

Prevent editing.

Build with these too