# Badge

> Compact status badge with solid and soft variants.

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

## Install

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

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

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

## Import

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

```tsx
import { Badge } from "@/components/ui/badge"
```

## Usage

```tsx
import { Badge } from "@/components/ui/badge"

export function Example() {
  return (
    <>
      <Badge>Primary</Badge>
      <Badge variant="secondary">Secondary</Badge>
      <Badge variant="success">Success</Badge>
    </>
  )
}
```

## API

### Badge

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | "primary" \| "secondary" \| "success" \| "success-soft" \| "warning" \| "destructive" \| "destructive-soft" \| "outline" \| "soft" | "primary" |  |

## Notes

- Soft success/warning variants use optional `--success` and `--warning` theme tokens.

## See also

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