available 1required 23Kbug 4in process 5in warehouse 67$solution provided 8pending release 9customer action 10This would truncate as it is too long
<ui5-badgecolor-scheme="1">available 1</ui5-badge><ui5-badgecolor-scheme="2">required 2</ui5-badge><ui5-badgecolor-scheme="3">3</ui5-badge><ui5-badgecolor-scheme="4">bug 4</ui5-badge><ui5-badgecolor-scheme="5">in process 5</ui5-badge><ui5-badgecolor-scheme="6">in warehouse 6</ui5-badge><ui5-badgecolor-scheme="7">7</ui5-badge><ui5-badgecolor-scheme="8">solution provided 8</ui5-badge><ui5-badgecolor-scheme="9">pending release 9</ui5-badge><ui5-badgecolor-scheme="10">customer action 10</ui5-badge><ui5-badgestyle="width:200px;">This would truncate as it is too long</ui5-badge>
Badge with Icon
done
in process
pending
<ui5-badgecolor-scheme="1"><ui5-iconname="accept"slot="icon"></ui5-icon>done
</ui5-badge><ui5-badgecolor-scheme="2"><ui5-iconname="sap-ui5"slot="icon"></ui5-icon></ui5-badge><ui5-badgecolor-scheme="3"><ui5-iconname="add-equipment"slot="icon"></ui5-icon>in process
</ui5-badge><ui5-badgecolor-scheme="4"><ui5-iconname="lab"slot="icon"></ui5-icon></ui5-badge><ui5-badgecolor-scheme="5"><ui5-iconname="email-read"slot="icon"></ui5-icon></ui5-badge><ui5-badgecolor-scheme="6"><ui5-iconname="pending"slot="icon"></ui5-icon>pending
</ui5-badge><ui5-badgecolor-scheme="7"><ui5-iconname="lightbulb"slot="icon"></ui5-icon></ui5-badge><ui5-badgecolor-scheme="8"><ui5-iconname="locked"slot="icon"></ui5-icon></ui5-badge>
Overview
The ui5-badge is a small non-interactive component which contains text information and color chosen from a list of predefined color schemes. It serves the purpose to attract the user attention to some piece of information (state, quantity, condition, etc.).
Usage Guidelines
If the text is longer than the width of the component, it doesn’t wrap, it shows ellipsis.
When truncated, the full text is not visible, therefore, it’s recommended to make more space for longer texts to be fully displayed.
Colors are not semantic and have no visual representation in High Contrast Black (sap_belize_hcb) theme.
ES6 Module Import
import "@ui5/webcomponents/dist/Badge";
Properties/Attributes
You can use both properties and attributes with the same effect. The name of each attribute is listed below the name of the property, if different.
Name
Type
Default Value
Description
colorScheme
color-scheme
string
"1"
Defines the color scheme of the component. There are 10 predefined schemes. Each scheme applies different values for the background-color and border-color. To use one you can set a number from "1" to "10". The colorScheme"1" will be set by default.
Note: Color schemes have no visual representation in High Contrast Black (sap_belize_hcb) theme.
Slots
This Element provides slot(s). This means it can display its child nodes.
Unless targeting the default slot, use the slot attribute to define the destination slot for each child.
Text, along with HTML Elements with no slot attribute, goes the the default slot.
Slot
Type
Description
default
Node [0..n]
Defines the text of the component. Note: Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.
icon
HTMLElement [0..n]
Defines the icon to be displayed in the component.
Theme:Morning Horizon (Light)Evening Horizon (Dark)Horizon High Contrast BlackHorizon High Contrast WhiteQuartz LightQuartz DarkQuartz High Contrast BlackQuartz High Contrast White