Badge
A compact marker for status, counts and categories.
- Display
- 1 file
- 2 npm packages
- Accessibility notes
Active
pnpm dlx @dowel-ui/cli add badgenpm packages installed: class-variance-authority, radix-ui.
import { Badge } from "@/components/ui/badge";Default
Variants
Sizes
With Icon
As Link
<Badge>
| Prop | Type | Default |
|---|---|---|
size | "sm" | "md" | "md" |
variant | "default" | "secondary" | "outline" | "destructive" | "success" | "warning" | "info" | "default" |
asChild | boolean | false |
Plus every attribute of <span>.
The badge label must convey the meaning on its own; variant colour is decoration. Use asChild to render an interactive badge as a link or button rather than adding handlers.
7/7
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — does not apply
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes