Skip to main content

Badge

Small status indicator or label. Perfect for displaying counts, statuses, categories, and notifications with full RTL support.

Preview

New
Beta
Soon

Installation

Terminalbash

Usage

Reacttsx

Examples

Variants

Default
Secondary
Destructive
Outline
tsx

With Icons

Verified
Featured
Error
Fast
tsx

Status Indicators

Active
Pending
Failed
Info
tsx

In Card Headers

Premium Feature

Pro

This feature is available on the Pro plan

Beta Testing

Beta

Currently in beta testing phase

Deprecated API

Deprecated

This API will be removed soon

tsx

In Lists

  • Dark Mode Support
    Included
  • Advanced Analytics
    Coming Soon
  • Legacy API
    Deprecated
  • Documentation
    In Progress
tsx

Notification Count

tsx

Custom Sizes

Tiny
Normal
Large
tsx

Custom Colors

Success
Warning
Info
Custom
Special
tsx

Props

NameTypeDefaultDescription
variant
'default' | 'secondary' | 'destructive' | 'outline''default'Visual style variant of the badge
className
stringundefinedAdditional CSS classes to apply

The Badge component extends all standard HTML div attributes including onClick and other event handlers.

Accessibility

Semantic HTML

Badges render as div elements and are purely presentational. They should be used alongside meaningful text.

Screen Readers

Badge text is announced by screen readers. Use descriptive text rather than ambiguous labels like "New" without context.

Color Alone

Don't rely solely on color to convey information. Use text and icons to ensure the meaning is clear for users with color vision deficiencies.

❌ Red
Failed

Interactive Badges

If a badge is clickable, wrap it in a button or add proper role, tabIndex, and keyboard handlers.

RTL Considerations

Badges automatically support RTL layout. Icons and text flow correctly in right-to-left languages.

LTR (English)

New
Beta
Coming Soon

RTL (العربية)

جديد
تجريبي
قريباً

Common Use Cases

  • Status Indicators: Show active, pending, completed, or error states
  • Categories and Tags: Label content with categories or keywords
  • Notification Counts: Display unread message or notification counts
  • Feature Highlights: Mark features as "New", "Beta", or "Pro"
  • Version Labels: Show version numbers or release stages
  • Role Indicators: Display user roles like "Admin", "Moderator", "Member"

Related Components