Heading
Section headings with rank separate from size.
`level` sets the heading rank and therefore the document outline; `size` sets the visual weight. Keeping them independent means you never have to pick the wrong rank to get the right size.
Import
import { Heading } from "@abbainitiative/ui";Also available from the subpath entry @abbainitiative/ui/heading.
This component has no state and no event handlers, so it renders inside a Server Component without a client boundary of your own.
Examples
Rank and size are independent
This h3 is styled at display size without disturbing the outline.
Page title
Section
Visually large, still an h3
<Stack gap={3}>
<Heading level={1}>Page title</Heading>
<Heading level={2}>Section</Heading>
<Heading level={3} size="display">Visually large, still an h3</Heading>
</Stack>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| level | 1 | 2 | 3 | 4 | 5 | 6 | 2 | Heading rank, rendered as the matching h1–h6 element. |
| size | "sm" | "md" | "lg" | "xl" | "display" | Visual size. Defaults to a sensible size for the level. | |
| tone | "default" | "muted" | "primary" | "default" | Semantic colour role. |
Accessibility
- Pick `level` for the document structure, never for the font size.
- Do not skip ranks — an h2 followed by an h4 breaks heading navigation.