Badges are small elements to show counts or labels separately or inside other components. There are a variety of styles and variations, including interactable ones.
The badge component can be used to complement other elements such as buttons or text elements as a label or to show the count of a given data, such as the number of comments for an article or how much time has passed by since a comment has been made.
Alternatively, badges can also be used as standalone elements that link to a certain page by using the anchor tag instead of a span element.
Default badge
Use the default badge to indicate counts, labels, or statuses inside or outside components.
Large badges
Use the .hc-badge--lg modifier and increase the height to create a larger variant.
Bold modifier
Sometimes a larger or bolder badge is necessary to convey prominent information, like a status that should be extremely apparent or a solitary label in a large interface component.
Create bold badges with the .hc-badge--bold modifier to make any of the above badge styles slightly larger and higher contrast. Combine with .hc-badge--lg to increase the size further.
Icon badge
You can also use icons inside the badge elements. If you add .hc-badge--icon to the badge itself these will be formatted and sized automatically.
Alternatively, you can also use badges which indicate only an icon by swapping the class to .hc-badge--icon-only. These icons should have the .hc-icon--12 size so that they don’t look so large given the icon badge’s default padding.
Avatar badge
Badge components with a user avatar or image are more fully defined in the separate user badge component, but you can create this effect in a simpler context with the class .hc-badge--avatar.
The image you select will be sized automatically, so make use of the size modifier classes on the parent badge to adjust accordingly.