Badge
Badge indicates the presence of one or more notifications available under a corresponding component.
Also known as: chip, counter, label, lozenge, notification badge, pill, status badge, status indicator, tag
Basic usage
Permalink to "Basic usage"- The badge component allows customization of the color and numeric count.
- Extra-small (XS) and small (SM) badges do not display a count.
<bolt-badge count="8"></bolt-badge>
Badge - Size variations
Permalink to "Badge - Size variations"<bolt-badge count="18" size="xs"></bolt-badge>
<bolt-badge count="18" size="sm"></bolt-badge>
<bolt-badge count="18" size="md"></bolt-badge>
<bolt-badge count="18" size="lg"></bolt-badge>
Badge - Color variations
Permalink to "Badge - Color variations"<bolt-badge count="18"></bolt-badge>
<bolt-badge count="18" color="light"></bolt-badge>
<bolt-badge count="18" color="dark"></bolt-badge>
Parameters
Permalink to "Parameters"color: optional. Defaults toerror. Other options include:darkandlight.size: optional. Defaults tomd. Other options include:xs,sm, andlg.count: optional. Sets the displayed number count.- Values below
2do not show a number count. - Numerical values are not shown with size
smorxs.
- Values below
General guidelines
Permalink to "General guidelines"- A Badge is a visual indicator placed closely in context to relevant content
- Badges are intentionally limited in color options so as to draw a user's attention.
- A Badge can be used with or without numeric values.
- A Badge should not use letters or symbols other than "+" (plus-sign).
- If a Badge includes a number, the maximum number displayed should be 99. For any number over 99, that number should be displayed as "99+".
- Badges should not be clickable.
When to use
Permalink to "When to use"- When attempting to draw a user's attention to the number of new items next to a link or button that provides access to these items. (e.g. to display a number that indicates how many unread alerts can be accessed from an accounts overview page.)
When not to use
Permalink to "When not to use"- Avoid using Badges for data that doesn't need highlighting.
When to use something else
Permalink to "When to use something else"- Use Chips, a Button or a Link if interaction is desired.
- If you want to indicate status, use text, Tag or Icon. Badges should not indicate status.
- Avoid standalone, floating Badges; consider Tag or alternative methods to draw a user's attention.
Do
- Use established color patterns for quick identification.
- Align Badges to the top of large text and center-align for standard size text.
- Attach a Badge to another element to draw the user's eye to the fact that something needs their attention in that area.
Don't
- Don't display multiple Badges on an element; reserve a single Badge for the most important information.
- Don't apply custom color mappings to Badges.
- Don't mix Badge sizes in the same context.
- Don't allow Badges to be cut off or collide with other elements.
- Don't change the position of Badges arbitrarily.
Content guidelines
Permalink to "Content guidelines"- If a Badge includes a number, the maximum number displayed should be 99. For any number over 99, that number should be displayed as "99+".
- A Badge should not use letters or symbols other than "+" (plus-sign).
Accessibility compliance
Permalink to "Accessibility compliance"-
WCAG 2.2 Compliant
-
JAWS 2025 Tested
-
NVDA 2025 Tested
-
VoiceOver Tested
-
Keyboard Tested
-
aXe Tested
Important Notes
Permalink to "Important Notes"- When using badge as a built-in option of another Bolt component, accessibility will handled by the component.
- When using
<bolt-badge>directly, developers are responsible for ensuring it is used in an accessible manner.
Best practices
Permalink to "Best practices"- When a badge is used as meta-information for other inline content, ensure that its meaning is clear.
- Consider adding an appropriate
aria-labelto communicate the necessary information. - If necessary, add screenreader-only (visually hidden) text as part of the element in which the badge is used.
All Bolt components have gone through accessibility testing, but please keep our accessibility guidelines in mind.