Skip to content
angulux
@anguless/angulux/badge

Badge

2 declarations3 demosbadge.md
import
import { BadgeModule } from '@anguless/angulux/badge';

Basic

The content of a badge is set with the value property.

2
<agl-badge value="2" />

Severity

Severity defines the colour of the badge.

2468935
<agl-badge value="2" /><agl-badge value="4" severity="secondary" /><agl-badge value="6" severity="success" /><agl-badge value="8" severity="info" /><agl-badge value="9" severity="warn" /><agl-badge value="3" severity="danger" /><agl-badge value="5" severity="contrast" />

Directive

aglBadge attaches a badge to any element, which is how it is put on a button, a toggle button or an icon.

Alerts
<agl-button label="Emails" aglBadge value="8" severity="secondary" /><agl-toggleButton [(ngModel)]="muted" onLabel="Muted" offLabel="Alerts" aglBadge value="3" severity="danger" /><i class="pi pi-bell" aglBadge value="2" style="font-size: 1.5rem"></i>

API

Generated from the committed corpus, which check:corpus holds to the built library.

BadgeDirective

directive[aglBadge]

Badge Directive is directive usage of badge component.

InputTypeDefaultDescription
ptBadgeDirective
deprecated — use pBadgePT instead.
BadgePassThrough | undefined undefined Used to pass attributes to DOM elements inside the Badge component.
pBadgePTBadgePassThrough | undefined undefined Used to pass attributes to DOM elements inside the Badge component.
pBadgeUnstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
badgeDisabled
property disabled
booleannot documentedWhen specified, disables the component.
badgeSize'large' | 'xlarge' | 'small' | null | undefinednot documentedSize of the badge, valid options are "large" and "xlarge".
size
deprecated — use badgeSize instead.
not documentedSize of the badge, valid options are "large" and "xlarge".
severity'secondary' | 'info' | 'success' | 'warn' | 'danger' | 'contrast' | null | undefinednot documentedSeverity type of the badge.
valuestring | numbernot documentedValue to display inside the badge.
badgeStyle{ [klass: string]: any } | null | undefinednot documentedInline style of the element.
badgeStyleClassstringnot documentedClass of the element.

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. Keys become attributes, and a key that names a DOM property is also assigned to that property. Values the browser would execute go through Angular's sanitizer first, as in a template binding: markup in `innerHTML`, `outerHTML` and `srcdoc`, and URLs in `href`, `src`, `action`, `formaction` and `xlink:href`. To write one of those unsanitized on purpose, pass a `DomSanitizer.bypassSecurityTrustHtml` or `bypassSecurityTrustUrl` value. An `on*` key must be a function, and any other value for it is ignored. Keys themselves are applied as given, so let data from users choose values, never keys.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.

Badge

componentagl-badge

Badge is a small status indicator for another element.

InputTypeDefaultDescription
styleClass
deprecated — since v20.0.0, use `class` instead.
stringnot documentedClass of the element.
badgeSize'small' | 'large' | 'xlarge' | nullnot documentedSize of the badge, valid options are "large" and "xlarge".
size'small' | 'large' | 'xlarge' | nullnot documentedSize of the badge, valid options are "large" and "xlarge".
severity'secondary' | 'info' | 'success' | 'warn' | 'danger' | 'contrast' | nullnot documentedSeverity type of the badge.
valuestring | number | nullnot documentedValue to display inside the badge.
badgeDisabledbooleannot documentedWhen specified, disables the component.

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. Keys become attributes, and a key that names a DOM property is also assigned to that property. Values the browser would execute go through Angular's sanitizer first, as in a template binding: markup in `innerHTML`, `outerHTML` and `srcdoc`, and URLs in `href`, `src`, `action`, `formaction` and `xlink:href`. To write one of those unsanitized on purpose, pass a `DomSanitizer.bypassSecurityTrustHtml` or `bypassSecurityTrustUrl` value. An `on*` key must be a function, and any other value for it is ignored. Keys themselves are applied as given, so let data from users choose values, never keys.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.