Skip to content

STR-003 Give each view one h1 and every other heading the level its place in the outline gives it

Level
Guideline, our choice
Verdict
Insufficient evidence (1 of 3 judges spoke)
Status
proposed, version 1.0.0

Rule

Give each view one h1 that names its main content. Give every other heading the level its place in the outline gives it: one below the heading it belongs under. Going down never skips a level; going back up may skip as many as needed.

Examples

Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.

Do: One h1, one level at a time

Page: Project settings

h1Project settings
h2Members
h3Pending invitations
h3Current members
h4Admins
h2Billing address

Back up from h4 to h2 is fine.

Simulated: the heading list a screen reader would build from this page's code:

  1. h1Project settings
  2. h2Members
  3. h3Pending invitations
  4. h3Current members
  5. h4Admins
  6. h2Billing address

Check: one h1, no skipped levels.

The list steps down one level at a time and the Check line is clean. After Admins (h4) the page goes back to Billing address (h2) in one step, which is fine. This is our own choice, not something the judges decided.

Don't: A level is skipped

Page: Project settings

h1Project settings
h2Members
h4Pending invitations
h2Billing address

Simulated: the heading list a screen reader would build from this page's code:

  1. h1Project settings
  2. h2Members
  3. h4Pending invitations
  4. h2Billing address

Check: h2 is followed by h4, so h3 is skipped.

Pending invitations is an h4 straight under an h2. The gap in the list is what makes a person wonder what they missed.

Don't: An h1 in the shell and one in the view

Page: Project settings, in the app shell

h1Ridgeway

The shared layout's header

h1Project settings
h2Members

Simulated: the heading list a screen reader would build from this page's code:

  1. h1Ridgeway
  2. h1Project settings
  3. h2Members

Check: 2 h1s.

The shared layout puts the product name in an h1 and each view adds its own. "Jump to the h1" has two answers and neither is clearly the main content.

Don't: A view with no h1

Page: Project settings

The header shows a logo

h2Project settings
h3Members

Simulated: the heading list a screen reader would build from this page's code:

  1. h2Project settings
  2. h3Members

Check: No h1.

The view starts at an h2, as when its title is a card title. There is no one place to begin.

Do: Written Markdown sits below the h1

Page: Spring launch

h1Spring launch
h2Comments

A comment written in Markdown:

h3Launch checklist

Its own # heading, shifted down to h3

Simulated: the heading list a screen reader would build from this page's code:

  1. h1Spring launch
  2. h2Comments
  3. h3Launch checklist

Check: one h1, no skipped levels.

A comment's own top heading becomes an h3 inside the h2 Comments, so the view keeps its single h1.

Why

Screen reader users often start a page by listing its headings, or by jumping to the first h1 and then from level to level. The levels are their map of the page. One h1 tells them where the main content starts and what it is. Levels that step down one at a time tell them which part belongs to which. A jump from h2 to h4 makes them wonder what they missed, and a view with no h1, or with three, gives them no clear place to begin. Whether text is a heading at all is STR-002a, and whether its words describe the part is STR-002b. This guideline only decides the level.

Our reasons

Fewer than two judges have spoken about heading levels, so the verdict is Insufficient evidence (1 of 3 judges spoke) and this guideline is our choice. Material supports it. So does GOV.UK, an expert witness who does not vote. No WCAG criterion requires it. A second h1 or a skipped level is not a documented failure. The Working Group's technique for organising a page with headings under 1.3.1 does nest them this way (G141), and so does its example of h1 to h6 (H42). We follow it for three reasons.

  • The levels are a map only if they are kept. People who move by level trust that an h3 belongs to the h2 above it. A level picked for any other reason sends them to the wrong place.
  • One start is easier than several. "Jump to the h1" is a quick way into the main content, and it only works when there is exactly one.
  • It is cheap to get right and easy to check. The level follows from the outline the team already has in mind. A linter or a heading list in the browser shows a gap at once.

Do

  • In the project tool Ridgeway, the view Project settings has one h1, Project settings. Its sections Members, Billing address and Delete project are h2. Inside Members, the parts Pending invitations and Current members are h3.
  • Put the product name in the app shell's header as plain text or a link to the start page, not as an h1. The h1 sits in each view, inside main, as STR-004 describes.
  • On a dashboard, the section This week is an h2, and each card in its grid has an h3 title, one below the section that holds it.
  • After an h4 deep in Members, the next section Billing address goes back to h2. Going back up any number of levels is fine.
  • Let a reusable component take its heading level from where it is used. SettingsSection accepts as="h2" or as="h3", or reads the level from a context the parent sets, so it fits both at the top of a view and nested inside another section.
  • When the view shows rich text or Markdown that a user wrote, shift its headings down so its top heading sits below the view's h1. A comment's own # heading becomes an h3 inside the section Comments, which is an h2.
  • A dialog is its own context. DialogTitle is an h2, and that is fine whatever the page behind it uses. It is not a skip, and it need not be an h1.
  • In the Ridgeway shell, the sidebar's list of projects may have its own h2, Projects. Where that sits in the outline next to the view's h1 is free.
  • The view's h1 and its title usually say the same thing. The title is STR-001.

Don't

  • Build an app shell where the header shows a logo and every view starts at a CardTitle or an h2, so no view has an h1.
  • Put the product name in an h1 in the shared layout and another h1 in each view.
  • Follow the h2 Members with an h4 Pending invitations, with no h3 between.
  • Hard-code <h3> inside SettingsSection, so it is one level too deep at the top of a view and right only when nested.
  • Show a user's Markdown with its h1 intact inside a view that already has one.

Exceptions

  • Content the team cannot change. A third-party embed, such as a payment form or a map widget, may bring headings whose levels do not fit the view. Fix what you can around it; the embed itself is outside this guideline.
  • Dialogs. A dialog's heading is outside the page's outline; see Do.
  • A product that chooses otherwise. This is a guideline. A product that orders its levels another way still marks its headings in code and words them to describe, as STR-002a and STR-002b, both rules, ask.

Verdict

Insufficient evidence (1 of 3 judges spoke). Only the judges decide; the expert witnesses are shown but do not vote. The judges do not settle this one, so it is a guideline: our own choice, with our reasons above. How verdicts work

Stances on STR-003
SourceRoleStancePage
WCAG 2.2LawSupports1.3.1 Info and Relationships
WCAG 2.2LawSupports2.4.6 Headings and Labels
Material DesignJudge SupportsAccessibility designing: structure
Apple Human Interface GuidelinesJudge No position
Carbon Design SystemJudge No position
GOV.UK Design SystemExpert witness SupportsWriting for user interfaces
Headings
Page template
Nielsen Norman GroupExpert witness No position

Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.

History

  • Version 1.0.0, : First version.

Last checked against the other rules for conflicts on .

More in Page structure: 7 rules and 1 guideline · All rules