Component

Typography

A directive that applies the design system’s text styles to any native element. Pick a variant — headings, paragraph, lead, blockquote, list, inline code, and helper sizes — then tune the colour, alignment, weight, and truncation without leaving your semantic markup.

Variants

Autumn in the Black Forest

The turning leaves

Colour & light

What to look for

A quiet season of mist, wind, and falling leaves.

Oaks and beeches turn amber and rust, the mornings grow cool and grey, and the forest floor fills with colour underfoot.

“Autumn is a second spring.”
  • Amber oak leaves
  • Cool, misty mornings
  • Chestnuts underfoot

The album ID is IMG·019 from Freiburg.

Large statement text

Small helper text

Muted secondary note

import { ChangeDetectionStrategy, Component } from '@angular/core';

import { HbTypographyImports } from '@herbst/ui';

@Component({
  selector: 'hb-demo-typography-variants',
  imports: [HbTypographyImports],
  template: `
    <div class="flex w-full max-w-lg flex-col gap-3">
      <h1 hbTypography="h1">Autumn in the Black Forest</h1>
      <h2 hbTypography="h2">The turning leaves</h2>
      <h3 hbTypography="h3">Colour & light</h3>
      <h4 hbTypography="h4">What to look for</h4>

      <p hbTypography="lead">A quiet season of mist, wind, and falling leaves.</p>
      <p hbTypography="p">
        Oaks and beeches turn amber and rust, the mornings grow cool and grey, and the forest floor
        fills with colour underfoot.
      </p>

      <blockquote hbTypography="blockquote">“Autumn is a second spring.”</blockquote>

      <ul hbTypography="list">
        <li>Amber oak leaves</li>
        <li>Cool, misty mornings</li>
        <li>Chestnuts underfoot</li>
      </ul>

      <p hbTypography="p">
        The album ID is <code hbTypography="inline-code">IMG·019</code> from Freiburg.
      </p>

      <p hbTypography="large">Large statement text</p>
      <p hbTypography="small">Small helper text</p>
      <p hbTypography="muted">Muted secondary note</p>
    </div>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HbDemoTypographyVariantsComponent {}

Colour, weight & align

Primary — saved

Success — uploaded

Warning — low light

Destructive — deleted

Muted — archived

Weight normal

Weight medium

Weight semibold

Weight bold

Aligned left

Aligned center

Aligned right

Justified paragraph that stretches each line to both edges so the autumn notes form a tidy rectangular block of text.

Truncate & custom class

Fixed 14rem column

Autumn morning in the Black Forest

Autumn morning in the Black Forest — wraps normally onto several lines.

Custom class

API reference

[hbTypography]

PropertyDescriptionTypeDefault
hbTypography The text style to apply. Put it on the matching semantic element (h1, p, blockquote, ul, code…). 'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'blockquote' | 'list' | 'inline-code' | 'lead' | 'large' | 'small' | 'muted' 'p'
[hbColor] Apply a semantic text colour. 'default' | 'muted' | 'primary' | 'destructive' | 'success' | 'warning'
[hbAlign] Horizontal text alignment. 'left' | 'center' | 'right' | 'justify'
[hbWeight] Override the font weight of the chosen variant. 'normal' | 'medium' | 'semibold' | 'bold'
[hbTruncate] Truncate overflowing text to a single line with an ellipsis. boolean false
[class] Extra classes merged over the variant styling. ClassValue ''