@anguless/angulux/badge
Badge
import
import { BadgeModule } from '@anguless/angulux/badge';Basic
The content of a badge is set with the value property.
<agl-badge value="2" />Severity
Severity defines the colour of the badge.
<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.
<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.
| Input | Type | Default | Description |
|---|---|---|---|
| pt deprecated — use pBadgePT instead. | BadgePassThrough | undefined | undefined | Used to pass attributes to DOM elements inside the Badge component. |
| p | BadgePassThrough | undefined | undefined | Used to pass attributes to DOM elements inside the Badge component. |
| p | boolean | undefined | undefined | Indicates whether the component should be rendered without styles. |
| badge property disabled | boolean | not documented | When specified, disables the component. |
| badge | 'large' | 'xlarge' | 'small' | null | undefined | not documented | Size of the badge, valid options are "large" and "xlarge". |
| size deprecated — use badgeSize instead. | not documented | Size of the badge, valid options are "large" and "xlarge". | |
| severity | 'secondary' | 'info' | 'success' | 'warn' | 'danger' | 'contrast' | null | undefined | not documented | Severity type of the badge. |
| value | string | number | not documented | Value to display inside the badge. |
| badge | { [klass: string]: any } | null | undefined | not documented | Inline style of the element. |
| badge | string | not documented | Class of the element. |
Inherited from BaseComponent
inherited| Input | Type | Default | Description |
|---|---|---|---|
| dt | Object | undefined | undefined | Defines scoped design tokens of the component. |
| unstyled | boolean | undefined | undefined | Indicates whether the component should be rendered without styles. |
| pt | PT | 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. |
| pt | PassThroughOptions | undefined | undefined | Used to configure passthrough(pt) options of the component. |
Badge
componentagl-badgeBadge is a small status indicator for another element.
| Input | Type | Default | Description |
|---|---|---|---|
| style deprecated — since v20.0.0, use `class` instead. | string | not documented | Class of the element. |
| badge | 'small' | 'large' | 'xlarge' | null | not documented | Size of the badge, valid options are "large" and "xlarge". |
| size | 'small' | 'large' | 'xlarge' | null | not documented | Size of the badge, valid options are "large" and "xlarge". |
| severity | 'secondary' | 'info' | 'success' | 'warn' | 'danger' | 'contrast' | null | not documented | Severity type of the badge. |
| value | string | number | null | not documented | Value to display inside the badge. |
| badge | boolean | not documented | When specified, disables the component. |
Inherited from BaseComponent
inherited| Input | Type | Default | Description |
|---|---|---|---|
| dt | Object | undefined | undefined | Defines scoped design tokens of the component. |
| unstyled | boolean | undefined | undefined | Indicates whether the component should be rendered without styles. |
| pt | PT | 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. |
| pt | PassThroughOptions | undefined | undefined | Used to configure passthrough(pt) options of the component. |