Components · Data Display · Badge
Back to Badge typesBadge
Use to draw attention to a count, a new item, or a status, without interrupting the flow - one Badge component, controlled by properties, not a one-off number or dot hard-coded per screen.
Properties
Badge has no hover/focus/disabled states - it is not interactive. Count and Max count below only visibly apply to the Count type; Status label only applies to the Status type. Change them below to check every type and color in the Live Preview.
Live Preview
All 3 forms compared side by side, each in Ant Design's own 5 Status Badge colors - Default, Success, Processing (a pulsing ring, for something actively in progress), Warning and Error. One matrix is rendered per selected Size, at the chosen Count, Max count and Status label.
When to use
Anywhere a count, a new-item signal, or a status needs to sit next to (or on top of) another element without interrupting the layout.
Component Guide
Overview
Badge draws attention to a count, a new item, or a status without interrupting the flow - a small dot, number, or short status label typically overlaid on or placed beside another element, like a notification bell or an avatar.
When to Use
- An unread notification count - a number badge on a bell or inbox icon.
- A new-feature indicator dot - flagging something recently added.
- An account status label or a cart item count - a compact signal attached to another element.
When Not to Use
- Standalone status text with no attached element - use Tag instead - Badge is meant to overlay or sit beside something else, not stand alone.
- A count so large or so central to the task that it deserves its own visible number in the main content - don't shrink primary information into a small corner badge.
- A persistent label describing a whole row or card's category - use Tag, which is built for that role.
Best Practices
- Cap large counts with a "99+" style ceiling rather than letting the badge grow to fit an arbitrarily large number.
- Reserve badge colors consistently (e.g. red for alerts, neutral for plain counts) across the product.
- Remove or hide the badge entirely at zero/none, rather than showing an empty "0".
Do and Don't
Do
A real count on the object it belongs to, so the number means exactly one thing: unread items in that inbox.
Don't
A sentence-length label defeats what a badge is for - a glance, not a read. Keep the label to a word or two, or drop it for the dot alone.
Accessibility
- The count or status is exposed to assistive technology as text, not conveyed by a colored dot alone.
- When overlaid on an icon button, the badge's information is included in that button's accessible name ("Notifications, 3 unread").
- Sufficient contrast between the badge and whatever it's layered on top of.
Related Components
Tag, Avatar, Notification.
{
"component": "Badge",
"category": "Data Display",
"summary": "Badge draws attention to a count, a new item, or a status without interrupting the flow - a small dot, number, or short status label typically overlaid on or placed beside another element, like a notification bell or an avatar.",
"whenToUse": [
"An unread notification count - a number badge on a bell or inbox icon.",
"A new-feature indicator dot - flagging something recently added.",
"An account status label or a cart item count - a compact signal attached to another element."
],
"whenNotToUse": [
"Standalone status text with no attached element - use Tag instead - Badge is meant to overlay or sit beside something else, not stand alone.",
"A count so large or so central to the task that it deserves its own visible number in the main content - don't shrink primary information into a small corner badge.",
"A persistent label describing a whole row or card's category - use Tag, which is built for that role."
],
"bestPractices": [
"Cap large counts with a \"99+\" style ceiling rather than letting the badge grow to fit an arbitrarily large number.",
"Reserve badge colors consistently (e.g. red for alerts, neutral for plain counts) across the product.",
"Remove or hide the badge entirely at zero/none, rather than showing an empty \"0\"."
],
"doAndDont": {
"do": "A real count on the object it belongs to, so the number means exactly one thing: unread items in that inbox.",
"dont": "A sentence-length label defeats what a badge is for - a glance, not a read. Keep the label to a word or two, or drop it for the dot alone."
},
"accessibility": [
"The count or status is exposed to assistive technology as text, not conveyed by a colored dot alone.",
"When overlaid on an icon button, the badge's information is included in that button's accessible name (\"Notifications, 3 unread\").",
"Sufficient contrast between the badge and whatever it's layered on top of."
],
"relatedComponents": [
"Tag",
"Avatar",
"Notification"
]
}