Skip to content

Typography (Heading, Text, Link, Code, Prose) for Angular

AngularTypography

Token-based typography as CSS classes that work without JavaScript (aui-heading–1..6, aui-text and modifiers, aui-link, aui-code, aui-prose, aui-truncate, aui-line-clamp), plus validated JS helpers: headings whose semantic level is independent of visual size, links restricted to http(s) and relative URLs that announce when they open a new tab, and a validated line clamp.

  • Heading, Text, LinkFactories and enhancers for headings, body text, and links on the type scale.
  • Safe linksOnly http(s) and relative destinations are accepted; other schemes are rejected.
  • New tab hintLinks that open a new tab say so in a localized, visually hidden hint.
  • Line clampClamp long text to a number of lines with one call.

Behavior, design tokens, and limitations are described on the Typography (Heading, Text, Link, Code, Prose) page; this page covers the Angular API.

import { Component, input } from '@angular/core';
import { AUI_TYPOGRAPHY } from '@absoluteui/angular/typography';
@Component({
selector: 'app-help',
imports: [...AUI_TYPOGRAPHY],
template: `
<h2 auiHeading size="4">Need help?</h2>
<p auiText tone="muted" [auiLineClamp]="2">We answer within one business day.</p>
<a auiLink [href]="supportUrl()" external>Contact support</a>`,
})
export class HelpComponent {
readonly supportUrl = input('https://example.com/support');
}
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 { AuiHeading, AuiText, AuiLink, AuiLineClamp } from '@absoluteui/angular/typography';

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

h1[auiHeading], h2[auiHeading], h3[auiHeading], h4[auiHeading], h5[auiHeading], h6[auiHeading]

Section titled “h1[auiHeading], h2[auiHeading], h3[auiHeading], h4[auiHeading], h5[auiHeading], h6[auiHeading]”

Class AuiHeading; template reference #ref="auiHeading".

<h2 auiHeading size="4">: the level comes from the tag, size (1 largest to 6) sets the visual size.

Server rendering: Renders in the browser only; on the server the element stays empty.

Input Type Default Description
size HeadingLevel Heading: visual size, default the level. Text: font size, default md.

Class AuiText; template reference #ref="auiText".

<p auiText tone="muted" size="sm">, <span auiText strong>.

Server rendering: Renders in the browser only; on the server the element stays empty.

Input Type Default Description
tone TextTone 'default' Text: muted uses color-text-muted.
size TextSize Heading: visual size, default the level. Text: font size, default md.
strong boolean false Text: semibold weight.

Class AuiLink; template reference #ref="auiLink".

<a auiLink href="https://example.com" external>Docs</a> or with routerLink. The href is validated like Link.create (http(s) or relative); external opens a new tab and says so to assistive technology in the scope’s locale.

Server rendering: Renders in the browser only; on the server the element stays empty.

Input Type Default Description
external boolean false Link: target=_blank, rel=“noopener noreferrer”, and a visually hidden localized “(opens in a new tab)”.
muted boolean false Link: muted color; the underline remains.

Class AuiLineClamp; template reference #ref="auiLineClamp".

<p auiText [auiLineClamp]="3">: clamp to 1..20 lines with an ellipsis.

Server rendering: Renders in the browser only; on the server the element stays empty.

Input Type Default Description
auiLineClamp number Required. setLineClamp: integer 1..20, written to –aui-lines.

Pattern: Native HTML text semantics: <h1>-<h6>, <p>, <a href>, <code>. Visual size is decoupled from heading level.

The Angular component renders the framework-neutral component, so its keyboard support, roles, WCAG 2.2 criteria, budgets, and import cost apply unchanged: see Typography (Heading, Text, Link, Code, Prose): Accessibility and performance.