- Docs
- Components
- Type
Heading
A section heading: the level sets the element, the size sets the look. The level is required, so the outline is always meant.
- Import
- @qeetrix/react
- Status
- StableSince 0.0.2
- Renders
<h1>–<h6>Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Import
// From the package: a build keeps only what it uses.
import { Heading } from "@qeetrix/react";
// Or from its own path.
import { Heading } from "@qeetrix/react/heading";02
Props
And every native attribute of the element it renders.
| Prop | Type | Default | What it does |
|---|---|---|---|
level | 1 – 6 | required | The element: <h1> to <h6>. |
size | "display-lg" … "title-sm" | by level | The look: 1 heading-lg, 2 heading-md, 3 heading-sm, 4 title-lg, 5 title-md, 6 title-sm. |
tone | "default" | "subtle" | "inverse" | — | Its colour. |
truncate | boolean | number | — | One line with an ellipsis, or a number of lines. |
align | "start" | "center" | "end" | — | Logical alignment. |
render | ReactElement | — | Another element: a link that looks like a heading. Prefer level. |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What it is |
|---|---|---|
heading | <h2> | h1–h6: data-size, data-tone. |
04
Display sizes
For welcoming pages, in the Geo letterforms; a console's titles keep the title sizes.
<Heading level={1} size="display-lg">One philosophy, many products</Heading>