# Badge: Sizes

> `sm`, `default` and `lg`. Icons, dots, the close button and counts scale with the badge.

Example: https://hextaui.com/docs/badge/examples/sizes
Component docs: https://hextaui.com/docs/badge.md

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/badge-sizes.json
```

This adds `components/examples/badge/sizes.tsx` with the Badge component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/badge/sizes.tsx"
import { IconCheck } from "@tabler/icons-react"

import { Badge, BadgeClose, BadgeCount, BadgeDot } from "@/components/ui/badge"

export function BadgeSizes() {
  return (
    <div className="flex flex-col items-center gap-3">
      <div className="flex flex-wrap items-center justify-center gap-2">
        <Badge size="sm">Small</Badge>
        <Badge size="sm" variant="success">
          <IconCheck data-icon="inline-start" />
          Paid
        </Badge>
        <Badge size="sm" variant="info">
          <BadgeDot pulse />
          Live
        </Badge>
        <Badge size="sm">
          design
          <BadgeClose />
        </Badge>
        <Badge size="sm">
          <BadgeCount value={42} />
        </Badge>
      </div>
      <div className="flex flex-wrap items-center justify-center gap-2">
        <Badge>Default</Badge>
        <Badge variant="success">
          <IconCheck data-icon="inline-start" />
          Paid
        </Badge>
        <Badge variant="info">
          <BadgeDot pulse />
          Live
        </Badge>
        <Badge>
          design
          <BadgeClose />
        </Badge>
        <Badge>
          <BadgeCount value={42} />
        </Badge>
      </div>
      <div className="flex flex-wrap items-center justify-center gap-2">
        <Badge size="lg">Large</Badge>
        <Badge size="lg" variant="success">
          <IconCheck data-icon="inline-start" />
          Paid
        </Badge>
        <Badge size="lg" variant="info">
          <BadgeDot pulse />
          Live
        </Badge>
        <Badge size="lg">
          design
          <BadgeClose />
        </Badge>
        <Badge size="lg">
          <BadgeCount value={42} />
        </Badge>
      </div>
    </div>
  )
}
```

## Props in this example

### Badge

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"default" \| "success" \| "info" \| "warning" \| "destructive"` | `"default"` | Colors the dot and icons in outline, or the surface in solid. |
| `size` | `"sm" \| "default" \| "lg"` | `"default"` |  |

### BadgeDot

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `pulse` | `boolean` | `false` | Adds a ping animation for live states. Off when reduced motion is on. |

### BadgeCount

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | `number` | – | Negative and non-finite values show 0. |

## More Badge examples

- [Variants and appearances](https://hextaui.com/docs/badge/examples/variants.md)
- [Removable](https://hextaui.com/docs/badge/examples/removable.md)
- [Controlled](https://hextaui.com/docs/badge/examples/controlled.md)
- [Counts](https://hextaui.com/docs/badge/examples/counts.md)
- [Interactive](https://hextaui.com/docs/badge/examples/interactive.md)
- [Long content](https://hextaui.com/docs/badge/examples/long-content.md)
- [Right to left](https://hextaui.com/docs/badge/examples/rtl.md)
