Badge
Badges help highlight important information, such as notifications or new and unread messages.
install | yarn add @clayui/badge |
---|---|
version | 3.111.0 |
Stable3.111.0View in LexiconCHANGELOG
Display Types
Badges are not used for non-numeric values. If you have a non-numeric value, use labels instead. Badges work for exact numbers up to 999. For numbers greater than 999, use K to indicate Thousands (5K for 5.231) and M to indicate Millions (2M for 2.100.523).
We recommend that you review the use cases in the Storybook.
Translucent
The boolean attribute translucent
renders a badge with an opaque background color optimized for light backgrounds.
Dark
The boolean attribute dark
renders a badge with an opaque background color optimized for dark backgrounds. It adds the class clay-dark
to the badge. The class clay-dark
can be added to the parent element to make badges contained inside render the dark variant. When adding clay-dark
to the parent element, the dark
attribute on the badge should be omitted.
Beta (Deprecated)
displayType="beta"
has been deprecated in favor of semantic attributes displayType="info"
and translucent
.A component to indicate beta features in DXP. The badge-beta
variant doesn’t have any interaction. It just informs the user. It uses a Badge component with custom visual states.
Beta Dark (Deprecated)
displayType="beta-dark"
has been deprecated in favor of semantic attributes dark
, displayType="info"
and translucent
.badge-beta-dark
is a dark variant of badge-beta
to be used with dark backgrounds.