Badge
A small status indicator for labeling items with colors, counts, or keywords
Quick Preview
Structure
Anatomy of the Badge โ a status pill with an optional inline icon.
States
Badge variants represent semantic states โ use them to communicate status at a glance.
Variants โ semantic states
Each variant signals a different meaning
Default
Neutral / informational
Success
Positive / completed
Warning
Caution / pending
Error
Failure / danger
Outline
Minimal / low emphasis
Secondary
Subtle / supporting
Sizes
Two size tokens โ sm md (default).
Sizes โ sm / md
Visual comparison across all variants and sizes
Default sm
Default md
Success sm
Success md
Warning sm
Warning md
Error sm
Error md
Installation
// Copy the Badge component fromsrc/components/ui/Badge.tsx
Usage
import { Badge } from '@/components/ui/Badge'export default function Example() {return <Badge variant="success">Active</Badge>}
Examples
Sizes
With Icons
In Context โ Product Card
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "success" | "warning" | "error" | "outline" | "secondary" | "default" | Color scheme of the badge |
size | "sm" | "md" | "md" | Size of the badge |
children* | React.ReactNode | - | Badge content |
className | string | - | Additional CSS classes |
Features
- โ6 color variants (default, success, warning, error, outline, secondary)
- โ2 sizes (sm, md)
- โRounded-full pill shape
- โBorder included in all variants
- โComposable โ accepts any children (text, icon, count)