# Tag

> Selectable or dismissible tag. Use inside TagGroup for selection.

Registry name: `tag`. HTML docs: https://ui.anuragroy.dev/component/tag.

## Install

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

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

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

## Import

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

```tsx
import { Tag } from "@/components/ui/tag"
```

## Usage

```tsx
import { Tag } from "@/components/ui/tag"
import { TagGroup } from "@/components/ui/tag-group"

export function Example() {
  return (
    <TagGroup label="Topics" selectionMode="multiple" defaultValue={["react"]}>
      <Tag value="react" removable>React</Tag>
      <Tag value="vue" removable>Vue</Tag>
    </TagGroup>
  )
}
```

## API

### Tag

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | string | — | Required selection key. |
| `variant` | "primary" \| "outline" \| "soft" | "primary" |  |
| `removable` | boolean | — |  |
| `removeLabel` | string | "Remove" |  |
| `disabled` | boolean | — |  |

## See also

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