Skip to the content

Text

Text renders every piece of copy in the design system. The variant prop resolves the HTML tag, size, weight and responsive scale in one step, so use a variant instead of native <p> or <h1> elements.
Typography & Media@apollion-dsi/core/elements/text22 kB gzip

When to use

Use when
  • You render running text, headings or metadata.
  • The visual style must differ from the semantic tag — combine variant with as.
  • A live number must flash when its value changes (tick).
Avoid when
  • You label a form control — use Label.
  • The text is a link — use Link.
  • The text sits next to an icon as one unit — use IconText.

Usage

loading

Content goes in text or children; when both are set, children wins.

Variants

Three groups: Block for running text, Headline for headings, Display for high-impact titles. Headline and Display variants grow from the md breakpoint and balance their line breaks.

Display d3

Headline h3

Lead paragraph

Paragraph

Meta caption

  • Block: p, span (default), lead, meta, blockquote.
  • Headline: h1–h6.
  • Display: d1–d4.

type="mobile" keeps the mobile size at every width; type="desktop" applies the md size at every width.

Tag and attributes

The rendered tag is as when set, otherwise the variant's tag, otherwise span. d1–d4 render h1–h4; meta and lead render p; every other variant renders its own name. The accepted HTML attributes follow the same tag, so variant="blockquote" takes cite and as="time" takes dateTime.

<Text variant="h1" as="h2">Looks like h1, is an h2</Text>

<Text variant="blockquote" cite="https://example.com/article">
  Quoted excerpt
</Text>

<Text as="time" variant="meta" dateTime="2026-07-30">
  30/07/2026
</Text>

Live values (tick)

Pass the number behind a live value as tick. On each change the ink snaps to success (up) or danger (down), then eases back over theme.animation.transitions.settle. Only the color moves. The first value is the baseline and equal values do not flash. With prefers-reduced-motion, the color snaps back without the transition.

<Text variant="h3" tick={lastPrice} text={formatPrice(lastPrice)} />

For a value that stays green or red, use color instead.

Accessibility

  • Pick the variant, or as, by document outline, not by size: one h1 per page, no skipped levels.
  • Any Link inside a Text is underlined, so it is distinguishable by more than color. Link.Button keeps its button look and flows inline.
  • The tick flash is color only; announce critical changes through another channel.

Read our privacy policy and the terms of use before proceeding.

Properties

See also