Skip to content

DisplayHeading

Hero example

Display heading

When to use

<DisplayHeading> is the marketing-surface display heading. Five sizes carry distinct geometric weight (mega → sub). The size you pick is independent of the HTML heading level — use as to set the right semantic element for the page outline.

For new product code in apps/app, prefer the level-aware atoms <HDisplay> / <H1> / <H2> / <H3> from @matter/components — same recipes, but the level is encoded in the component name, which reads cleaner in dashboard markup.

Do — separate the visual size (size) from the document level (as). A size="hero" headline can be as="h2" if the page already has an h1.
Don't — set inline font-size to "tune" a heading. The five sizes are intentional. Pick the closest one.

Anatomy

A single heading element (default <h2>, override via as) with one size class. CSS class hooks per size — each carries a V1 alias for backward compatibility:

SizeV2 classV1 alias
mega.display-mega(standalone — no V2 alias yet)
hero.m-h-display.display-hero
section.m-h1.display-section
card.m-h2.display-card
sub.m-h3.display-sub

The aliases share one CSS rule each, so V1 <DisplayHeading> (from @repo/brand/components/display-heading) and V2 <DisplayHeading> (from @matter/components) render pixel-identically during the action 9 consumer migration.

Props

PropTypeDefaultDescription
sizeDisplayHeadingSize"section"
asReact.ElementType
childrenReact.ReactNode

Also accepts Omit<React.HTMLAttributes<HTMLHeadingElement>, "children">.

size controls the visual recipe; as controls the semantic level. Both are independent and should be set deliberately.

States

DisplayHeading is stateless.

Density

Density-agnostic — display headings ignore the site density toggle. Marketing-tier typography has a fixed visual identity.

Themes

Display heading

Display heading

Display heading

Tokens consumed

typography46 tokensv2.3.0
clamp(44px, 6.4vw, 92px)
matter
src ↗
450
matter
src ↗
-0.038em
matter
src ↗
1
matter
src ↗
clamp(34px, 4vw, 54px)
matter
src ↗
450
matter
src ↗
-0.03em
matter
src ↗
1.05
matter
src ↗
clamp(26px, 2.6vw, 36px)
matter
src ↗
450
matter
src ↗
-0.022em
matter
src ↗
1.12
matter
src ↗
clamp(20px, 1.8vw, 24px)
matter
src ↗
500
matter
src ↗
-0.015em
matter
src ↗
1.2
matter
src ↗
96px
brand
src ↗
64px
brand
src ↗
54px
brand
src ↗
48px
brand
src ↗
40px
brand
src ↗
var(--font-geist-sans), ui-sans-serif, system-ui, -apple-system, sans-serif
brand
src ↗
var(--font-geist-sans), ui-sans-serif, system-ui, -apple-system, sans-serif
brand
src ↗
400
brand
src ↗
96px
brand
src ↗
100%
brand
src ↗
-0.026em
brand
src ↗
var(--font-geist-sans), ui-sans-serif, system-ui, -apple-system, sans-serif
brand
src ↗
400
brand
src ↗
64px
brand
src ↗
100%
brand
src ↗
-0.015em
brand
src ↗
var(--font-geist-sans), ui-sans-serif, system-ui, -apple-system, sans-serif
brand
src ↗
400
brand
src ↗
54px
brand
src ↗
100%
brand
src ↗
-0.01em
brand
src ↗
var(--font-geist-sans), ui-sans-serif, system-ui, -apple-system, sans-serif
brand
src ↗
400
brand
src ↗
48px
brand
src ↗
100%
brand
src ↗
-0.005em
brand
src ↗
var(--font-geist-sans), ui-sans-serif, system-ui, -apple-system, sans-serif
brand
src ↗
400
brand
src ↗
40px
brand
src ↗
1.15
brand
src ↗

Each size reads its corresponding --display-* token family — font-size, line-height, letter-spacing all controlled there.

Accessibility

  • Keyboard interactions. None — heading elements are not interactive. Screen-reader users navigate via heading shortcuts.
  • ARIA roles and properties. Inherits implicit role from as (heading for h1–h6). Level set via as="h2", as="h3", etc.
  • Focus order. N/A. Heading anchors (when present) carry scroll-margin-top so anchored navigation doesn't bury the heading under a sticky header (WIG accessibility rule).
  • Screen-reader expectations. Announces as "{text}, heading, level N."
  • Reduced motion. N/A.
  • Forced colors. Renders as WindowText. Weight and tracking preserved.
  • WIG rules. Hierarchical headings (h1 → h2 → h3, no skipping) — as choice respects the page's heading outline. scroll-margin-top on anchored headings (WIG headings rule).

Do / Don't

Do — pick size by visual weight ("how big should this read?") and as by document level ("what level in the outline is this?").
Don't — skip heading levels. An h2 should follow an h1, not an h4.
Do — use mega for hero headlines, hero for sub-hero / section openers, section for major sections, card for card titles, sub for sub-headings.
Don't — render <DisplayHeading size="mega"> more than once per page. The mega size is the visual centre; one per page.
Do — prefer <HDisplay> / <H1> / <H2> / <H3> from @matter/components inside apps/app. Level-aware atoms read cleaner in dashboard code.
Don't — use the V1 @repo/brand/components/display-heading import once the consumer migration has landed. The V2 alias is canonical.

Recipes

This component appears in:

Code example

import { DisplayHeading } from "@matter/components";

export function PricingHero() {
  return (
    <DisplayHeading as="h1" size="mega">
      Form your company in 90 seconds.
    </DisplayHeading>
  );
}

Source

packages/components/src/DisplayHeading

On this page