Title
Semantic heading (h1 to h6) with size and line-height variants; the heading level is independent of the visual size.
Status: stable. Group: display. Markdown version: /design-system/components/title.md
When to use
Title renders page and section headings with the semantic level decoupled from the visual scale: pick the h1 to h6 tag with level or as, then choose the size (xxs to xxl) independently, so the document outline stays honest while the layout gets the right optics.
When not to use
- Do not default Title typography on pattern headings that already define font-display or module classes; use unstyled + existing className.
- Do not visually size a heading by passing custom inline styles; use the size variants so the typography stays in the system.
- Do not nest a Title inside a Button. Use the Button's text slot directly.
- Do not use Title for body copy or form labels; Text and Label own those semantics.
Look-alikes
Props
| Prop | Type | Default | Description | Required |
|---|---|---|---|---|
children | React.ReactNode | ReactI18NextChildren | Iterable<ReactI18NextChildren> | none | Heading text. | Yes |
as | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | none | Override the rendered element (h1-h6); wins over level. | No |
className | string | undefined | "" | Additional CSS class names. | No |
unstyled | boolean | false | When true, only sets the heading tag + className (no Title token typography). Use in patterns/pages that already define font/size in CSS or Tailwind. | No |
size | "xl" | "xs" | "s" | "xxs" | "m" | "l" | "xxl" | l | Display size token for the heading. | No |
level | 1 | 2 | 3 | 4 | 5 | 6 | none | Semantic heading level (maps to h1-h6 when as is unset). | No |
lineHeight | "normal" | "tight" | "snug" | "relaxed" | "loose" | none | Line height variant. | No |
flush | boolean | false | Drop the block margins. Use when the parent owns spacing: a row, a cell, a card or a flex/grid gap. | No |
Variants
- Available sizes:
xxs,xs,s,m,l,xl,xxl(defaultl). - Allowed
asvalues:h1,h2,h3,h4,h5,h6. - Allowed
levelvalues:1,2,3,4,5,6. - Allowed
lineHeightvalues:normal,tight,snug,relaxed,loose.
Invalid combinations
The contract records no invalid combinations.
Keyboard
The contract records no keyboard interaction.
Rules
Every item under When not to use is a MUST NOT. MUST and SHOULD follow RFC 2119.
| Level | Rule | How it is checked |
|---|---|---|
| MUST | ARIA: Use correct heading level via as or level prop. | Not yet verified: no evidence record. WCAG 4.1.2. |
| MUST | The accessibility tree (role, name, state) matches the committed snapshot for every required story. | Automated by npm run test:stories:matrix:ci. WCAG 1.3.1, 4.1.2. |
| MUST | The component remains legible and operable under a real browser forced-colors: active pass. | Manual review, last on 2026-11-04. |
| MUST | A human completed an end-to-end accessibility review of this component. | Manual review, last on 2026-11-04. |
| SHOULD | Decide the semantic level from the document outline first, then pick the visual size that fits the layout. | Not stated in the contract. |
| SHOULD | Always pass level or as when the page already has an h1; the default tag is h1. | Not stated in the contract. |
| SHOULD | Use size m or s for section headers in product chrome. Title always renders h1 to h6; display text with no place in the outline belongs in Text. | Not stated in the contract. |
| SHOULD | Reach for size xl or xxl on hero headlines; the visual size scales the optics independently of the semantic level. | Not stated in the contract. |
| SHOULD NOT | Do not let the visual size choose the heading level; skipped levels break rotor navigation. | Not stated in the contract. |
Install and import
- Install:
npm install @digitaltableteur/react(version 0.9.1, restricted access on npm). - Import:
import { Title } from "@digitaltableteur/react"; - Entry point:
@digitaltableteur/react/typographyexports it too. - Styles: import
@digitaltableteur/react/style.cssonce at the app boundary. - Also available as the custom element
<dt-title>; see the custom elements manifest.
Links
- Machine-readable contract (Design System Contract 1.0)
- Markdown version of this page
- Component index as JSON
- All components
- Source: The implementation lives in a private repository. This page, its Markdown twin and the contract are generated from it at build time and are the public source of truth.