Internal ID software / Text
Heading
A heading where the level in the outline and the text style are two decisions.
Not drawn in Figma: built only from the tokens, for internal ID software. In code: components/software/typography.tsx. From the old system: Heading and Eyebrow in @id-identity-as/ui/layout.
Example
Ordrer
Afventer godkendelse
Seneste syv dage
Ordrer
Afventer godkendelse
Seneste syv dage
import { Heading } from '@/components/software/typography';
<Heading level={1}>Ordrer</Heading>
<Heading level={2} size="heading-md">Afventer godkendelse</Heading>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
level (required) | 1 | 2 | 3 | 4 | 5 | 6 | The level in the outline of the page: 1 for the page title, 2 for a section. | |
size | 'display-xl' | 'display-lg' | 'display-md' | 'display-sm' | 'heading-md' | 'heading-sm' | The Figma text style. Without it: display-md for level 1, display-sm for 2, heading-md for 3, heading-sm below. | |
id | string | For aria-labelledby on the region the heading names. |
Do
- Choose the level from the outline, then the size from what the page needs.
- One level 1 per page.
- In a dense tool, set the page title in display-sm and the sections in heading-md.
Do not
- Do not pick h3 because h2 looked too big. Keep the level and change the size.
- Do not set a heading in capitals or in a colour. The old eyebrow in mono capitals is gone.
Accessibility
- The level is what a screen reader navigates by. Do not skip one.
Tokens it uses
- type.display.xl
- type.display.lg
- type.display.md
- type.display.sm
- type.heading.md
- type.heading.sm