# TagInput

Add, remove and deduplicate tags without losing the keyboard path.

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

## Usage

```tsx
"use client";

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

export function Example() {
  const [value, setValue] = useState(["interface", "motion"]);
  return <TagInput label="Topics" 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/tag-input
```

## Props

- `value / onValueChange`: `string[] / function`. Controlled tag list.
- `maxTags`: `number` (default `12`). Maximum accepted tags.

## Accessibility

Enter/comma adds, Backspace removes the last tag. Each remove button is named; errors are announced and focus returns to the input.

## Motion

CSS transitions explain state changes. Reduced motion removes travel.
