Badge
A small status indicator component for displaying tags, counts, or status information.
npx @slipstream-ui/cli@latest add badgeVariants
NewInfoErrorBeta3Active
Status & count badges
NewBetaActive
31299+
Messages3
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | false | Render the child (e.g. a router Link) with badge styling. |
| variant | 'default' | 'secondary' | 'destructive' | 'outline' | 'default' | Visual style variant |
| size | 'sm' | 'md' | 'lg' | 'md' | Pill scale: sm for dense tables, lg for hero and metadata strips. |
| children | ReactNode | required | Content to display |
Accessibility
- Badge content is announced by screen readers
- All variants meet WCAG AA contrast requirements
- Consider adding aria-label for status-only badges
- Use semantic status terminology
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+ — macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA — the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.