Skip to content
angulux
@anguless/angulux/badge

badge

2 declarations3 demos
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. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
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. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.