Display
Badge
A small label for status or category. Renders a span, or anything via render.
packages/design-system/components/ui/badge.tsx
Examples
Anatomy
- 01Pill, 20px tall
- 02Optional icon, 12px
- 03Label, text-xs medium
Usage
import { Badge } from "@repo/design-system/components/ui/badge";
<Badge variant="secondary">Popular</Badge>
<Badge render={<Link href="/pricing" />}>Pricing</Badge>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | "default" | Link and ghost only show a fill on hover. |
| render | ReactElement | (props, state) => ReactElement | none | Base UI's replacement for asChild: render the part as another element, such as a Button or a Link. |
| className | string | none | Merged last with cn(). Use it for layout (width, margin), not to restyle the component. |
Guidance
Do
- Keep it to one or two words.
Don't
- Use it as a button.