React Tailwind Badges for Tags, Status, and Updates
A badge is a small UI element used to highlight short pieces of information. Badges are commonly used to indicate status, tags, labels, or updates on items in a user interface.
They are compact, colorful, and serve as visual cues for users to take note of something quickly.
Common Use Cases
- Mark an item as "New" or "Updated"
- Show a status like "In Progress", "Completed", etc.
- Add labels or tags to blog posts or products
- Display user roles or levels (e.g., "Admin", "Pro")
- Highlight notifications or unread messages
React Tailwind Badge
Available Variants
The Badge
component supports multiple color variants to represent different statuses:
success
– used for positive status or confirmationswarning
– for alerts or caution messagesinfo
– for general informative badgeserror
– for failure or error statesneutral
– for a default or subtle look
Styles
The component also supports two style modes:
solid
– filled background with contrasting textoutline
– bordered with no background
React Tailwind Badge Component Code
Badge Variants Demo
Success Variant
success - solidsuccess - outline
Warning Variant
warning - solidwarning - outline
Info Variant
info - solidinfo - outline
Error Variant
error - soliderror - outline
Neutral Variant
neutral - solidneutral - outline
Customization Options
- Change shape: Use
rounded-full
instead ofrounded-b-2xl rounded-tl-2xl
to create pill-shaped badges. - Add new variants: You can easily extend the
badgeVariants
object to support more color styles likepurple
,blue
, etc.
Feel free to find me on LinkedIn if you have any component requests or suggestions.