# Color Area

> 2D color area. Must sit inside ColorPicker.

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

## Install

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

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

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

## Import

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

```tsx
import { ColorArea } from "@/components/ui/color-area"
```

## Usage

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

export function Example() {
  return (
    <ColorPicker defaultValue="#3b82f6">
      <ColorArea
        colorSpace="hsb"
        xChannel="saturation"
        yChannel="brightness"
        className="h-44 w-64"
      />
    </ColorPicker>
  )
}
```

## API

### ColorArea

React Aria ColorArea. `ColorThumb` is also exported.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colorSpace` | ColorSpace | — |  |
| `xChannel` | ColorChannel | — |  |
| `yChannel` | ColorChannel | — |  |

## Notes

- The color family uses `react-aria-components`, not Base UI.

## See also

- [HTML page](https://ui.anuragroy.dev/component/color-area): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/color-area.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.
