# ColorPicker

Named swatches and a native custom-color dialog, with the hex value always visible.

- Family: Forms, imported from `mizu-ui` or `mizu-ui/forms`
- Docs: https://mizu.user64bit.world/components/color-picker
- Source: https://github.com/0xuser64bit/mizu/blob/main/packages/mizu/src/forms/Selection.tsx

## Usage

```tsx
"use client";

import { useState } from "react";
import { ColorPicker } from "mizu-ui";

export function Example() {
  const [value, setValue] = useState("#ff4d1c");
  return (
    <ColorPicker label="Signal color" value={value} onValueChange={setValue} />
  );
}
```

## Copy it with the shadcn CLI

```sh
npx shadcn@latest init 0xuser64bit/mizu/preset # once, where there is no components.json
npx shadcn@latest add 0xuser64bit/mizu/color-picker
```

## Props

- `value / onValueChange`: `string / function`. Six-digit hex color and callback.
- `swatches`: `string[]`. Optional hex choices.

## Accessibility

Swatches have color names/values and pressed state; a labelled native color input supplies custom selection.

## Motion

CSS transitions explain state changes. Reduced motion removes travel.
