Best practice
- Use badges sparingly to avoid “visual noise” and overwhelming the user
- Use for new or unread items, e.g. messages or notifications
- Use for showing a count on relevant UI elements, e.g., the number of new comments
- The badge should be dynamic and updated in real time when possible
- Use the same appearance (colour) across the application for the same use case
Supported components
Default badge
The default badge can contain numbers (count) or letters (label).
Count badge
By default, the badge displays numbers up to 99. If the number exceeds 99, a plus sign (+) is added at the end.
In code, you can set a max cap on the value. For example, if you set the max cap to 10, then all numbers over 10 will be displayed as 10+.
Label badge
The badge can also contain label text that can be used for use cases where you want to announce something more specific about the parent UI element. For example, to highlight that something is in “beta” or “new”.
Dot badge
The badge comes in a dot variant, which is used for more subtle notifications, e.g. an online/offline status or if “something is new” without an exact count.
Appearances
The badge has 4 appearances - Error, Info, Success and Warning. Choose a colour for the badge that works well for the use case and draws the right amount of attention. Ensure that there is enough contrast between the parent UI element and the badge.
Fit
The badge comes in 2 different fits (sizes): small and medium. Which fit to choose depends on the parent UI element.
As a general rule, you should:
- Use the small badge on small UI parent elements.
- Use the medium badge on medium and large UI parent elements.
Pinned or inline
The badge can be “pinned” on the parent UI element or placed “inline”, e.g. in a menu list item or a sidebar navigation item.
Positioning
If the badge is “pinned”, then you have the option to position the badge on the top right corner or the bottom right corner of the parent UI element.
If placed “inline” then you can position the badge to the right or left in the parent UI element.
Distance
If the badge is “pinned”, then you can use the “distance” option/property in Figma and Code to adjust the positioning between small, medium and large distances. Always make sure that the badge does not cover crucial information.
Here are a number of examples of what not to do.