Copy to clipboard
Installation
Copy to clipboard
npx bearnie add badge
npx bearnie add badge
bunx bearnie add badge
bunx bearnie add badge
pnpm dlx bearnie add badge
pnpm dlx bearnie add badge
yarn dlx bearnie add badge
yarn dlx bearnie add badge
Copy to clipboard
import Badge from "@/components/ui/badge/Badge.astro";
Usage
import { Badge } from "@/components/ui/badge"
<Badge variant="default | secondary | destructive | outline | success | warning | info">Badge</Badge>
Examples
Variants
Copy to clipboard
Status variants
Copy to clipboard
With icon
Use data-icon="inline-start" or data-icon="inline-end" to position icons.
Copy to clipboard
With spinner
Copy to clipboard
Link
Use the href prop to render a badge as a link.
Copy to clipboard
Anatomy
Badge- A single inline element for labels
Props
Badge
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | ”default” | “secondary” | “destructive” | “outline” | “success” | “warning” | “info" | "default” | Visual style variant |
| href | string | - | Renders badge as a link |
| class | string | - | Additional CSS classes |