Badge
Display a small count or new-state indicator associated with an element.
Usage guide
#Show short counts or status indicators as supporting information, such as notification counts. Use Tag or body text for longer explanations.
Attach to a target
Wrap the target element to display the badge at its corner.
Display independently
Use standalone without attaching to another element.
Indicate only that something changed
Use dot to indicate a new state without a number.
Examples
#Feature examples
#Choose a feature from 10 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.
No matching features.
API reference
#Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.
<sy-badge>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
boolean | false | Show a dot instead of a number. | |
boolean | false | Hide the component. | |
boolean | false | Standalone badge that does not wrap another element. | |
number | Infinity | Maximum displayed count. Larger counts use a + suffix. | |
number | 0 | Count to display. | |
'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'topRight' | Corner of the wrapped element where the badge appears. | |
'small' | 'medium' | 'medium' | Component size. | |
'red' | 'yellow' | 'green' | 'blue' | 'gray' | 'red' | Component display style. |
Slots
| Slot | Description |
|---|---|
| Component body or child items. |