Badges are small containers with numeric values placed adjacent to a UI element. Badges indicate a running tally or count of a specific type of content, for example systems with risks number of volumes or number of drives.
The basic badge includes a count of a specific item, up to three digits. The badge is not interactive nor does it convey status.
<span class="luci-badge"> 3 </span>
<span class="luci-badge"> 42 </span>
<span class="luci-badge"> 873 </span>
<span class="luci-badge"> 999+ </span>
Use the light version when the badge is a non-essential element on the screen and should recede from the primary content.
<span class="luci-badge luci-badge--light"> 3 </span>
<span class="luci-badge luci-badge--light"> 42 </span>
<span class="luci-badge luci-badge--light"> 873 </span>
<span class="luci-badge luci-badge--light"> 999+ </span>
The badge inherits the LUCI warning notification color when it is intended to convey a warning status within a user interface.
<span class="luci-badge luci-badge--warning"> 3 </span>
<span class="luci-badge luci-badge--warning"> 42 </span>
<span class="luci-badge luci-badge--warning"> 873 </span>
<span class="luci-badge luci-badge--warning"> 999+ </span>
<span class="luci-badge luci-badge--error"> 3 </span>
<span class="luci-badge luci-badge--error"> 42 </span>
<span class="luci-badge luci-badge--error"> 873 </span>
<span class="luci-badge luci-badge--error"> 999+ </span>
Badges only contain numeric values up to three digits. If your count exceeds three digits, first reconsider whether a badge is the appropriate interface element to use. For example, is this number still meaningful at this level or could the count be better represented in a different way? If a count exceeds three digits and it is an appropriate and useful data point, the component allows for the addition of a plus sign “plus” to ensure users are aware that it represents more than the displayed number.
<span class="luci-badge"> 999+ </span>
<span class="luci-badge luci-badge--light"> 999+ </span>
<span class="luci-badge luci-badge--warning"> 999+ </span>
<span class="luci-badge luci-badge--error"> 999+ </span>
Place badges directly adjacent to the related UI item. See examples below for appropriate applications:
Badges are designed to work on light, white and dark backgrounds.
<span class="luci-badge"> 999+ </span>
<span class="luci-badge luci-badge--light"> 999+ </span>
<span class="luci-badge luci-badge--warning"> 999+ </span>
<span class="luci-badge luci-badge--error"> 999+ </span>
Class | Applies to | Outcome |
---|---|---|
|
|
Adds light styling. |
|
|
Adds warning styling. |
|
|
Adds error styling. |