Skip to main content
The Badge component provides a flexible way to display tags, statuses, and labels with semantic meaning. It supports both solid filled variants and outlined variants with status indicators.

Import

Basic Usage

Props

BadgeVariant
default:"default"
Badge style variant that determines the visual appearanceAvailable variants:
  • default - Primary color badge
  • success - Green background, white text
  • warning - Yellow background, white text
  • error - Red/destructive background, white text
  • neutral - Secondary color badge
  • outline-success - Outlined with green status dot
  • outline-warning - Outlined with orange status dot
  • outline-error - Outlined with red status dot
  • outline-info - Outlined with blue status dot
  • outline-neutral - Outlined with neutral status dot
React.ReactNode
required
Badge content (typically text)
string
Additional CSS classes for custom styling

Variant Examples

Solid Variants

Solid badges have colored backgrounds with contrasting text:

Outline Variants

Outline badges have a border and include a colored status dot:

Common Use Cases

Order Status

User Role Tags

Payment Status

Integration with DescriptionCard

Badges work seamlessly with the DescriptionCard component for status fields:

TypeScript

The component exports its prop types for TypeScript usage:

Accessibility

The Badge component:
  • Uses semantic HTML with proper color contrast ratios
  • Includes focus states for interactive use cases
  • Supports all standard HTML div attributes

Styling

The Badge component uses Tailwind CSS utilities and can be customized: