Pins a small sui-badge to a corner of the child in its slot: the unread count on a bell, a presence dot on an avatar. The badge is always the sm size and wears a 2px surface ring so it reads over the child. Give the child a label that includes the number, because the badge itself has none.
import { Component } from "@angular/core";
import { SuiOverlayBadge } from "@shineui/angular";
@Component({
standalone: true,
imports: [SuiOverlayBadge],
template: `<sui-overlay-badge value="3"><sui-icon-button icon="fa-regular fa-bell" variant="outline" aria-label="Notifications, 3 unread"></sui-icon-button></sui-overlay-badge>`,
})
export class Example { }
Basic
The badge itself carries no role or label, so the count reaches assistive tech only through the control underneath. Give that control an aria-label that already includes the number, as the bell does here.
Badge color role from the status system. Defaults to accent, unlike a bare badge. Reflected.
value
value
number | string | undefined
Count or short text shown in the badge. Ignored in dot mode.
Slots
Slot
Description
(default)
The element the badge is anchored to (an icon button, an avatar). Wrap exactly one child.
Types
SuiBadgeSeveritytypeThe shared status ladder plus the three emphasis roles a count badge also needs.
No members.
SuiOverlayBadgePositiontype
No members.
SuiSeveritytype
No members.
Theming
Every design token this element can render with, read from its own stylesheets and the ones it imports. Set a token on :root or on any ancestor and every use below follows it. The values shown are the ones in the theme you are viewing. The list is read per stylesheet, so an element that imports a shared drawing module lists that module's tokens too, whether or not it paints with all of them.