Skip to content

Badge for Angular

AngularData display

Short static label such as ‘Active’, ‘Beta’, or ‘3 new’ that classifies the content next to it. The label text carries the meaning; tone colors, the optional dot, and the optional icon are decorative. Never interactive.

  • Five tonesNeutral, info, success, warning, and error, in subtle or outline style.
  • Dot or iconA status dot or any icon in front of the label.
  • Two sizesSmall and medium sizes for tables, lists, and headers.
  • Plain text labelThe label is real text, so screen readers read it in context.

Behavior, design tokens, and limitations are described on the Badge page; this page covers the Angular API.

import { Component } from '@angular/core';
import { AuiBadge } from '@absoluteui/angular/badge';
@Component({
selector: 'app-invoice-status',
imports: [AuiBadge],
template: `<aui-badge [label]="overdue ? 'Overdue' : 'Paid'" [tone]="overdue ? 'error' : 'success'" [dot]="true"></aui-badge>`,
})
export class InvoiceStatusComponent {
overdue = true;
}
Terminal window
npm install @absoluteui/angular @absoluteui/components @absoluteui/core @absoluteui/theme

Setup with provideAbsoluteUI() is covered in Getting started. Styles are included with the component.

import { AuiBadge } from '@absoluteui/angular/badge';

Defaults for every instance: provideAbsoluteUIConfig({ components: { badge: { ... } } }) (see Configuration).

Class AuiBadge; template reference #ref="auiBadge".

Server rendering: Renders on the server; the browser re-creates it after hydration.

Input Type Default Description
label string Required. Visible text; carries the meaning.
tone BadgeTone 'neutral' Decorative tone color.
variant BadgeVariant 'subtle' subtle: tone fill; outline: tone boundary.
size BadgeSize 'md' Badge size.
icon IconRef | null Decorative icon before the label.
dot boolean false Decorative status dot before the label (not with icon).

Pattern: Static text: no role; the label is read in document order with the content it classifies.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Badge: Accessibility and performance.