# Color Swatch

> Color swatch preview.

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

## Install

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

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

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

## Import

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

```tsx
import { ColorSwatch } from "@/components/ui/color-swatch"
```

## Usage

```tsx
import { ColorSwatch } from "@/components/ui/color-swatch"

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

## API

### ColorSwatch

React Aria ColorSwatch.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `color` | string \| Color | — |  |

## See also

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