Heading
Semantic h1–h6 in Merid's heading style: weight 600, negative tracking and text-wrap: balance. The visual size is independent of the level, so the outline stays correct while the design stays consistent.
Ship calmer interfaces
<Heading level={2}>Ship calmer interfaces</Heading>Import
import { Heading } from "@merid/react";Examples
Default sizes
Each level has a default size: level 1 is display, 2 is h2, 3 is h3, and 4–6 map to lg, md and sm.
Display
Heading h2
Heading h3
Heading lg
Heading md
Heading sm
<Heading level={1}>Display</Heading>
<Heading level={2}>Heading h2</Heading>
<Heading level={3}>Heading h3</Heading>
<Heading level={4}>Heading lg</Heading>
<Heading level={5}>Heading md</Heading>
<Heading level={6}>Heading sm</Heading>Size independent of level
Pick level from the document outline and size from the design. A settings panel title may be an h2 that looks like a small heading.
Billing history
Invoices
<Heading level={2} size="lg">Billing history</Heading>
<Heading level={3} size="sm">Invoices</Heading>API reference
Heading forwards its ref to the heading element and passes other HTML attributes through.
| Prop | Type | Default | Description |
|---|---|---|---|
level | 1 | 2 | 3 | 4 | 5 | 6 | 2 | Semantic level: renders h1–h6. |
size | "display" | "h2" | "h3" | "lg" | "md" | "sm" | – | Visual size. Defaults by level: display, h2, h3, lg, md, sm. |
Styling
| Hook | Values |
|---|---|
.mrd-heading | Root <h1>–<h6> |
data-size | display · h2 · h3 · lg · md · sm |
Sizes read the typography tokens (see Typography); there are no heading-specific variables.
Accessibility
- Keep one
h1per page and do not skip levels going down; changesize, notlevel, to adjust the look. - Never use a heading only for large text — use Text with
size="lg".
Guidelines
Do
Choose level from the page outline and size from the design.
Avoid
Jump from h2 to h5 because the smaller size looked right.
Related
- Text — body copy and captions.
- VisuallyHidden — headings that only assistive tech needs.