Newer Version Available
lightning:badge
Represents a label which holds a small amount of information, such as the number of unread notifications.
A lightning:badge is a label that holds small amounts of information. A badge can be used to display unread notifications, or to label a block of text. Badges don’t work for navigation because they can't include a hyperlink.
This component inherits styling from badges in the Lightning Design System.
Here is an example.
1<aura:component>
2 <lightning:badge label="Label" />
3</aura:component>Attributes
| Attribute Name | Attribute Type | Description | Required? |
|---|---|---|---|
| body | Component[] | The body of the component. In markup, this is everything in the body of the tag. | |
| class | String | A CSS class for the outer element, in addition to the component's base classes. | |
| label | String | The text to be displayed inside the badge. | Yes |