Badge Component

Displays a badge or a component that looks like a badge.

Variants

Four badge variants for different use cases.

Default
Secondary
Destructive
Outline

Usage Examples

Common use cases for badges.

Status Indicators

Active:
Active
Pending:
Pending
Error:
Error
Draft:
Draft

Notification Counts

Messages
3
Unread
12
Completed
24

Tags/Labels

React
TypeScript
Tailwind CSS
Blazor
C#

Feature Flags

New Feature
NEW
Beta
BETA
Deprecated
DEPRECATED

In Lists

Badges combined with other components.

Project Alpha

Active development

In Progress

Project Beta

Under review

Review

Project Gamma

Deployment failed

Failed

Project Delta

Planning phase

Draft

Custom Styling

Override styles with the Class parameter.

Large Badge
Square Corners
Custom Color
Gradient

With Icons

Badges can include icons or other content.

Verified
Closed
Featured
Favorite

Accessibility Notes

Best practices for using badges accessibly.

Keep text concise: Badges work best with 1-2 words or small numbers.

Meaningful content: Badge text should be self-explanatory.

Color alone: Don't rely solely on color to convey meaning. Include text.

Context: Ensure the badge's meaning is clear from surrounding content.

API Reference

Variant

Type: BadgeVariant

The visual style variant. Options: Default, Secondary, Destructive, Outline. Default: Default

Class

Type: string?

Additional CSS classes to apply to the badge element.

ChildContent

Type: RenderFragment?

The content to display inside the badge (text, icons, numbers, etc.).

An unhandled error has occurred. Reload 🗙