- iOS:
GOVUKFontBuilderin govuk-once/govuk-mobile-ios-gov-kit/GovKitUI/Sources/Styles/Font+Extensions.swift at 8a7641e - iOS:
HeaderViewin govuk-once/govuk-mobile-ios-app/Production/govuk_ios/SwiftUIViews/HeaderView.swift at 1e520fc1 - iOS:
InfoViewin govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/Common/Info/InfoView.swift at 1e520fc1 - iOS:
SectionHeaderLabelViewin govuk-once/govuk-mobile-ios-gov-kit/GovKitUI/Sources/Components/Views/SectionHeaderLabelView.swift at 8a7641e - Figma: none linked yet
- Apple Human Interface Guidelines: Typography, the text styles
- The app prototyping system's heading, which this follows (app-prototyping-system, exploration-2/kit/components/heading)
Heading
Titles a screen, or a section of one. Its level says where it sits in the screen's outline, for screen readers; its size, which of the app's text styles it is drawn in.
Native component
Examples
Each size
HTML
<govuk-app-heading level="1" size="large-title">Large Title</govuk-app-heading>
<govuk-app-heading level="1" size="title-1">Title 1</govuk-app-heading>
<govuk-app-heading level="2" size="title-2">Title 2</govuk-app-heading>
<govuk-app-heading level="2" size="title-3">Title 3</govuk-app-heading>
<govuk-app-heading level="3" size="body">Body</govuk-app-heading>
A screen's question
HTML
<govuk-app-heading level="1" size="title-1">Are you sure you want to sign out?</govuk-app-heading>
Centred, on an onboarding screen
HTML
<govuk-app-heading level="1" align="center">Allow notifications?</govuk-app-heading>
Sizes by level, when none is given
HTML
<govuk-app-heading level="1">Your local council</govuk-app-heading>
<govuk-app-heading level="2">Bins and recycling</govuk-app-heading>
<govuk-app-heading level="3">Collection days</govuk-app-heading>
Inputs
| Attribute | Type | Default | Description |
|---|---|---|---|
level |
"1" | "2" | "3" | "4" | "5" | "6" |
2 |
Its place in the screen's outline: 1 is the screen's title, 2 a section of it, 3 a part of a section. Drawn as h1 to h6. |
size |
"large-title" | "title-1" | "title-2" | "title-3" | "body" |
The text style it is drawn in. Without one, level 1 is Large Title, level 2 is Title 3, and anything smaller is Body, emphasised. | |
align |
"start" | "center" |
start |
center, as the app's onboarding and information screens set their titles. |
Content
The heading's text.
Outputs
None.
Rules
- Give every screen one level 1 heading, unless its navigation bar has a title, which is the screen's heading instead.
- Don't skip levels: a level 3 heading goes inside a section with a level 2 one.
- Pick the level for the outline and the size for the look. A screen's question, such as What is your postcode?, is level 1 in Title 1; an outcome, such as a confirmation, is level 1 in Large Title.
- Centre a heading only on screens the app centres: onboarding, information and confirmation screens. Centre the text under it too.
- Write headings in sentence case, without a full stop. A question ends with a question mark.
When not to use it
| When | Use instead |
|---|---|
| Over a section the user can act on as a whole, such as a widget with Edit | govuk-app-section-heading |
| For a part of a long screen, with its title and the space above it | govuk-app-section |
| For a title over a list of rows | govuk-app-grouped-list title="Privacy and legal" |
| For a screen's title, when it has a navigation bar | govuk-app-nav-bar title="Settings" |
| For a line that should stand out, but doesn't head anything | govuk-app-text emphasis |
| For a few words that say what the rest of a line is | govuk-app-strong |
The iOS, Android and Figma sources it was built from
Screenshots of the app's own component, to compare the examples with
iOS