Color Picker
A colour picker supporting HEX, RGB and HSB formats.
Last updated:04/10/2026, 05:17:37
npm install @chaos-design/color-picker
import { ColorPicker } from "@chaos-design/color-picker";
- Install the dependency
npm install @chaos-design/color-picker
- Use the component
import { ColorPicker } from "@chaos-design/color-picker";
import { useState } from "react";
export default function Demo() {
const [color, setColor] = useState("#000000");
return <ColorPicker color={color} onChange={setColor} />;
}
| Prop | Type | Default | Description |
|---|
| color | string | - | Current colour value (HEX). |
| onChange | (color: string) => void | - | Callback when the colour changes. |
| onBack | () => void | - | Back callback (optional). |
| className | string | - | Custom class name. |
| classNames | ColorPickerClassNames | - | Custom class names for internal elements. |
| Prop | Type | Description |
|---|
| sbContainer | string | Saturation / brightness area container. |
| slidersContainer | string | Sliders area container. |
| hueSlider | string | Hue slider. |
| opacitySlider | string | Opacity slider. |
| preview | string | Colour preview swatch. |
| inputsContainer | string | Inputs area container. |
| formatSelect | string | Format selection dropdown. |
| hexInput | string | HEX input. |
| rgbInput | string | RGB input. |
| hsbInput | string | HSB input. |
| opacityInput | string | Opacity input. |