Default
Secondary
Destructive
Outline
Badge Component
A small status indicator component for highlighting items, tags, or labels.
- Multiple variants: default, secondary, destructive, and outline
- Compact and accessible design
- Perfect for displaying status, categories, or counts
Installation
The Badge component is part of our UI library. You can import it directly from the components directory.
Usage
Here is how to use the badge in your project.
React TSX
React TSX
Examples
Default Badge
New
Secondary Badge
Secondary
Destructive Badge
Error
Outline Badge
Outline
Custom Styled Badge
Custom
API Reference
Badge Component Props
Prop | Type | Default | Description |
---|---|---|---|
variant | 'default' | 'secondary' | 'destructive' | 'outline' | 'default' | Controls the visual style of the badge |
className | string | - | Additional CSS classes to apply to the badge |
children | ReactNode | - | The content of the badge |
Additionally, the Badge component accepts all standard HTML div attributes.
CSS Classes
The badge uses the following CSS class variants:
Variant Classes
default
: Primary color badge with background and white textsecondary
: Secondary color badge with background and white textdestructive
: Red/danger badge for highlighting errors or warningsoutline
: Badge with a border and transparent background