

Ī badge inside a link with no badge background color. This link is followed by a badge.Ī badge inside a link with too many characters to fit inside the badge. This link contains a badge.Ī badge near, but not included in, a link. The value of the data-badge attribute is centered in the badge. More than three characters will not cause an error, but some characters may fall outside the badge and thus be difficult or impossible to see. Note: Because of the badge component's small size, the data-badge value should typically contain one to three characters. Add a data-badge attribute and quoted string value for the badge. Add one or more MDL classes, separated by spaces, to the element using the class attribute. Include any desired attributes and content. Their design and use is therefore an important factor in the overall user experience.


However, depending on the intent, the badge itself may or may not be part of the link.īadges are a new feature in user interfaces, and provide users with a visual clue to help them discover additional relevant content. A "Join the discussion!" button might have an accompanying badge indicating the number of users currently participating in the discussion.Ī badge is almost always positioned near a link so that the user has a convenient way to access the additional information indicated by the badge.A "You have unpurchased items in your shopping cart" reminder might include a badge showing the number of items in the cart.A "New messages" notification might be followed by a badge containing the number of unread messages.

You can use a badge to unobtrusively draw the user's attention to items they might not otherwise notice, or to emphasize that items may need their attention. A badge can be both a notifier that there are additional items associated with an object and an indicator of how many items there are. A badge consists of a small circle, typically containing a number or other characters, that appears in proximity to another object. The Material Design Lite (MDL) badge component is an onscreen notification element.
