# Color Picker

> Composed color picker: area, hue slider, and hex field by default.

Registry name: `color-picker`. HTML docs: https://ui.anuragroy.dev/component/color-picker.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/color-picker.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/color-picker.json`.

Registry JSON: https://ui.anuragroy.dev/r/color-picker.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/color-picker.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

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

## Usage

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

export function Example() {
  return <ColorPicker defaultValue="#3b82f6" />
}
```

## API

### ColorPicker

React Aria ColorPicker. Pass `children` to replace the default layout.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | string \| Color | — |  |
| `defaultValue` | string \| Color | — |  |
| `onChange` | (color) => void | — |  |

## Notes

- Default composition installs `color-area`, `color-slider`, and `color-field` as registry dependencies.

## See also

- [HTML page](https://ui.anuragroy.dev/component/color-picker): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/color-picker.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
