Badge
Displays a badge or a component that looks like a badge.
DefaultSecondaryDestructiveOutline
Badge — pastille compacte pour un status, un tag, ou un compteur. 4 variants shadcn : default (primary), secondary, destructive, outline.
Installation
$ bext ui add badge
Copy and paste the following into src/components/ui/badge.tsx.
Usage
Anatomy
<Badge variant="default|secondary|destructive|outline">Label</Badge>
API Reference
Badge
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "default" | "secondary" | "destructive" | "outline" | "default" | Style. default=bg-primary, secondary=bg-secondary, destructive=bg-destructive, outline=border seulement. |
| className | string | — | Utility Tailwind supplémentaire. |
Accessibility
Purement décoratif — pas de rôle ARIA. Si le badge porte une info importante non-répétée dans le texte (ex "New"), ajouter un <span class="sr-only">.
Edit this example live in the bext playground — it compiles and runs entirely in your browser.
The React idiom — same UI, for comparison.
On This Page