STR-004 Build the page's regions from landmark elements, and name repeated ones apart
- Level
- Rule
- Verdict
- Unanimous (2 of 2)
- Area
- Page structure
- Status
- proposed, version 1.0.0
Rule
Build the page's regions from landmark elements: the main content in main, the top bar in header, each group of navigation links in nav and the bottom bar in footer. When a page has more than one nav, give each a name that tells them apart.
Examples
Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.
Do: Regions are landmarks, navs are named
<header>Ridgeway · Account menu
<nav aria-label="Main">Projects · Reports
<nav aria-label="Projects">Spring launch · Autumn sale
<main>The view
<footer>Help · Status
Simulated: the landmark list a screen reader would build from this page's code:
- banner, no name
- navigation, named “Main”
- navigation, named “Projects”
- main, no name
- contentinfo, no name
main and the footer. The screen reader adds "navigation" itself, so the names do not.Don't: A shell built from divs
<div>Ridgeway · Account menu
<div>Spring launch · Autumn sale
<div>The view
<div>Help · Status
Simulated: the landmark list a screen reader would build from this page's code:
No landmarks. A person who lists them finds nothing.
div. The landmark list is empty, so there is nothing to jump between and a person passes every link on the way to the content.Don't: Two navs with no names
<header>Ridgeway · Account menu
<nav>Projects · Reports
<nav>Spring launch · Autumn sale
<main>The view
<footer>Help · Status
Simulated: the landmark list a screen reader would build from this page's code:
- banner, no name
- navigation, no name
- navigation, no name
- main, no name
- contentinfo, no name
Don't: A second main
<header>Ridgeway · Account menu
<nav aria-label="Main">Projects · Reports
<nav aria-label="Projects">Spring launch · Autumn sale
<main>The shell's inset
<main>The page's own main
<footer>Help · Status
Simulated: the landmark list a screen reader would build from this page's code:
- banner, no name
- navigation, named “Main”
- navigation, named “Projects”
- main, no name
- main, no name
- contentinfo, no name
main, and the page adds another inside it. A page has one, so the list offers two and neither is clearly the content.Why
A screen reader can list a page's landmarks and jump straight to one, so a person can go from the top bar to the main content in one step instead of passing every link on the way. That only works when the regions are built from landmark elements. A page made of divs has no regions to jump to. Two navigation landmarks that are both announced as "navigation" leave the person to try each one to find the menu they wanted.
No WCAG criterion requires landmarks. The Working Group lists them as a sufficient technique (ARIA11) for two criteria. Under WCAG 2.2, 1.3.1 Info and Relationships they are one way to make the page's regions readable from the code. Under 2.4.1 Bypass Blocks they are one of several ways to let people get past blocks that repeat on every page, such as a header and a sidebar (Understanding 2.4.1). A correct main is therefore one way to meet 2.4.1, not the only one. A page can meet both criteria without landmarks.
Do
- In the project tool Ridgeway, the app shell is a
headerwith the product name and the account menu, a sidebar with anav, the view inmain, and afooterwith the links Help and Status. - Keep one
mainon each page. In shadcn,SidebarInsetalready rendersmain, so put the view's content inside it and do not add anothermainin the page. - In shadcn's sidebar blocks, the
headersits insideSidebarInset, so it is part ofmainand not the page's top bar. Move a top bar that spans the product outsideSidebarInset, or treat the innerheaderas the view's own. - shadcn's
Sidebarrendersdivs. Wrap theSidebarMenuthat holds links in anav. - The page has a
navin the top bar, one in the sidebar and a breadcrumb trail. Name them "Main", "Projects" and "Breadcrumb", witharia-labelor witharia-labelledbypointing to a visible heading. The screen reader adds "navigation" itself, so the name does not repeat it. shadcn'sBreadcrumbalready rendersnav aria-label="breadcrumb", so it needs no wrapper of its own. - A sign-in page with no header still puts its form in
main. - A chat panel docked beside the view is an
asidewith a name, such as "Team chat". - Our own advice: name any other landmark that appears more than once too, such as two
asides or two namedsections, so each can be told apart. - Our own advice, which ARIA11 also suggests: put all content inside some landmark, so a person moving by landmark misses nothing. The skip link is the one exception: NAV-004 keeps it on its own before the regions.
- A skip link is a second route past the repeated blocks, for people who use a keyboard without a screen reader. It is outside this rule; NAV-004 is our guideline for it.
- Use the native elements.
role="main"on amainelement does no harm, but it adds nothing. - A search form may use the
searchelement orrole="search". That is optional. - Name a
sectiononly when it is a region people will want to jump to, such as Activity on a project page. A namedsectionbecomes a landmark; one without a name does not.
Don't
- Build the shell as
<div className="flex min-h-screen">with adivfor the top bar, adivfor the sidebar and adivfor the content. - Add
<main>inside a page that is already rendered insideSidebarInset, so the page has two. - Put the view's content beside
SidebarInsetinstead of inside it, so it falls outsidemain. - Leave the top bar's
navand the sidebar'snavwithout names, so both are announced as "navigation" and nothing else. - Name a
nav"Main navigation nav" or "Sidebar navigation menu". - Give every
sectionon the page anaria-label, so the landmark list fills up with regions nobody jumps to.
Exceptions
- Header and footer inside content. A
headerorfooterinside anarticleor asectionbelongs to that part and is not the page's top or bottom bar. That is correct HTML. Only the ones at the top level of the page become its banner and its footer landmark. - Dialogs. A dialog is not a landmark. While it is open it sits outside the page's
main. - Not covered here. The order of regions in the code is LAY-002. The
h1insidemainis STR-003.
Verdict
Unanimous (2 of 2). Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work
| Source | Role | Stance | Page |
|---|---|---|---|
| WCAG 2.2 | Law | Supports | 1.3.1 Info and Relationships |
| WCAG 2.2 | Law | Supports | 2.4.1 Bypass Blocks |
| Material Design | Judge | Supports | Accessibility designing: structure |
| Apple Human Interface Guidelines | Judge | No position | |
| Carbon Design System | Judge | Supports | Accessibility: Developers Global header UI shell header: Accessibility |
| GOV.UK Design System | Expert witness | Supports | Page template Skip link |
| Nielsen Norman Group | Expert 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
Justified is an independent project. It is not affiliated with, sponsored or endorsed by the organisations whose guidance it cites. Read the full statement.
Apple is a trademark of Apple Inc., registered in the U.S. and other countries and regions.