# Badge: Right to left

> Icons, the close button and the collapse animation follow the reading direction. Counts always read left to right.

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

## Add this example

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

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

## Source

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

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

export function BadgeRtl() {
  return (
    <div dir="rtl" className="flex flex-wrap items-center justify-center gap-2">
      <Badge variant="success">
        <IconCheck data-icon="inline-start" />
        مدفوع
      </Badge>
      <Badge>
        <BadgeDot pulse />
        مباشر
      </Badge>
      <Badge>
        تصميم
        <BadgeClose />
      </Badge>
      <Badge>
        <BadgeCount value={120} />
      </Badge>
    </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. |

### 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)
- [Sizes](https://hextaui.com/docs/badge/examples/sizes.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)
