Componente

Typography

Uma diretiva que aplica os estilos de texto do design system a qualquer elemento nativo. Escolha uma variante — títulos, parágrafo, lead, citação, lista, código inline e tamanhos auxiliares — e então ajuste a cor, alinhamento, peso e truncamento sem abandonar seu markup semântico.

Variantes

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 {}

Cor, peso e alinhamento

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.

Truncar e classe custom

Fixed 14rem column

Autumn morning in the Black Forest

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

Custom class

Referência de API

[hbTypography]

PropriedadeDescriçãoTipoPadrão
hbTypography O estilo de texto a aplicar. Coloque-o no elemento semântico correspondente (h1, p, blockquote, ul, code…). 'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'blockquote' | 'list' | 'inline-code' | 'lead' | 'large' | 'small' | 'muted' 'p'
[hbColor] Aplica uma cor de texto semântica. 'default' | 'muted' | 'primary' | 'destructive' | 'success' | 'warning'
[hbAlign] Alinhamento horizontal do texto. 'left' | 'center' | 'right' | 'justify'
[hbWeight] Sobrescreve o peso da fonte da variante escolhida. 'normal' | 'medium' | 'semibold' | 'bold'
[hbTruncate] Trunca o texto que transborda em uma única linha com reticências. boolean false
[class] Classes extras mescladas sobre o estilo da variante. ClassValue ''