···11+---
22+title: Color Picker
33+description: Compose color components to create a color picker.
44+---
55+66+import { PropDocs } from '../../lib/PropDocs'
77+import { Example } from '../../lib/Example'
88+import { DefaultEditor } from '../../examples/color-picker/default-editor'
99+import { CustomChildren } from '../../examples/color-picker/custom-children'
1010+import { Swatches } from '../../examples/color-picker/swatches'
1111+import { AlphaChannel } from '../../examples/color-picker/alpha-channel'
1212+1313+This component provides a `DefaultColorEditor` component that contains a basic color picker with support for `hsb`, `hsl` and `rgb` values.
1414+It simply composes other color components, which you can also easily do yourself to customize the picker.
1515+1616+<Example src={DefaultEditor} />
1717+1818+## Installation
1919+2020+Run the following command to add the color picker to your project.
2121+2222+```bash
2323+pnpm hip install color-picker
2424+```
2525+2626+## Props
2727+2828+This component is built using the React Aria ColorPicker.
2929+See the official guide for full behavior and API details.
3030+3131+- Docs: [React Aria ColorPicker](https://react-spectrum.adobe.com/react-aria/ColorPicker.html#reusable-wrappers)
3232+3333+<PropDocs components={["ColorPicker", "DefaultColorEditor"]} />
3434+3535+## Examples
3636+3737+### Default Editor
3838+3939+The `DefaultColorEditor` composes a `ColorArea`, `Hue` and `Alpha` sliders, a format `Select`, and a format-aware `ColorField`.
4040+4141+<Example src={DefaultEditor} />
4242+4343+### Custom Children
4444+4545+Compose any color UI you like inside `ColorPicker`.
4646+4747+<Example src={CustomChildren} />
4848+4949+### Swatches
5050+5151+You can add swatches to the color picker by passing an array of colors to the `swatches` prop.
5252+5353+<Example src={Swatches} />
5454+5555+### Alpha Channel
5656+5757+You can hide the alpha channel by passing `false` to the `hasAlpha` prop.
5858+5959+<Example src={AlphaChannel} />
6060+6161+## Related Components
6262+6363+- [ColorArea](/docs/components/color-area)
6464+- [ColorSlider](/docs/components/color-slider)
6565+- [ColorField](/docs/components/color-field)
6666+- [ColorSwatchPicker](/docs/components/color-swatch-picker)
6767+6868+