Page hero
Every page opens with the same three parts, spaced by tokens, so the site reads as one piece however many people add pages to it.
From idea to tested prototype in weeks
Strategy, prototyping and build, from a small team you work with directly.
---
import PageHero from '../components/PageHero.astro';
---
<PageHero
crumbs={[{ href: '/insights/', label: 'Insights' }]}
title="From idea to tested prototype in weeks"
lede="Strategy, prototyping and build, from a small team you work with directly." /> When to use it
- At the top of every page: it is how a page opens.
- The page templates add it. A hand-built page uses the same three parts.
Use something else when:
- The page opens on a full-width picture or film: a video hero, which carries the heading itself.
- It is a section inside a page: a section heading, not a second hero.
How it works
- Breadcrumb (optional): the page's parents as links, in sentence case, for pages that sit inside a section (an insight, a case study, a Somnia DS page). It sits directly before the heading so the 16 px gap applies automatically. Top-level pages don't need one: the highlighted item in the main menu already says where you are.
- No eyebrow. Somnia DS no longer puts an all-caps, tracked-out label above headings. Hierarchy comes from weight, size and spacing.
- Heading: the page's only
h1, in sentence case, stating the page's point rather than its topic. - Lede: one or two sentences, 17 px, secondary text colour, up to 58 characters a line.
- Hero text is capped at
size.measure-hero(820 px).
The layout check
A build step reads every generated page and warns if it has more or fewer than one h1, if a breadcrumb isn't immediately before the heading, if inline styles change hero spacing, or if the heading isn't inside a known hero.
Accessibility
What it does for you
- The page’s one main heading, and the first heading in the page’s content.
- A breadcrumb, when there is one, comes straight before it; the opening sentence straight after, or on an article its byline.
- The build warns about a page with no main heading, with two, or with a breadcrumb out of place.
- The opening sentence is the secondary text colour, checked against the page in light and dark.
What you need to do
- A heading that says the page’s point, in sentence case.
- One or two sentences under it.
- No label above it.
Keyboard
| Key | What it does |
|---|---|
| Tab | Nothing of its own: only the breadcrumb’s links. |
What a screen reader is told
- "Heading level 1", then the opening sentence as a paragraph.
This is what the browser reports to assistive technology. What each screen reader then says varies, and has not been listened to yet.
WCAG 2.2
| Criterion | Level | How this meets it |
|---|---|---|
| 1.3.1 Info and Relationships | A | One main heading, marked as one. |
| 1.4.3 Contrast (Minimum) | AA | The opening sentence against the page. |
| 2.4.6 Headings and Labels | AA | What the heading says is the page’s to get right. |
The criteria this component has a part in. A page that uses it still has to meet the rest.
Checked
| Check | How | Result |
|---|---|---|
| Automated (axe-core) | WCAG 2.0, 2.1 and 2.2 rules at A and AA, the page in light and in dark | Passed Nothing found, light or dark |
| Narrow screen | No sideways scrolling at 320px wide (WCAG 1.4.10) | Passed No sideways scrolling |
| Keyboard and what the browser reports | Real key presses on the live example, and the role, name and state given to assistive technology | Passed 4 of 4 checks pass |
| On paper | Somnia’s print check: no overlaps, stranded headings or controls on the page | Passed No faults on 4 sheets |
| Screen reader | Listened to by a person, in VoiceOver and NVDA | Not yet Not yet checked by a person |
The 4 checks made with the keyboard, on the example at the top of this page:
- Passed A page has one main heading, and it is the first heading in the page’s content
- Passed The browser reports it as a heading at level 1
- Passed A breadcrumb comes straight before the heading, and the opening sentence straight after (on an article, its byline)
- Passed The opening sentence has at least 4.5:1 against the page, in light and dark
Run by script on against Somnia DS 1.89.0, in Chromium with axe-core 4.14.0. How these checks work, and every component's results.
Not yet checked
- How it sounds in a screen reader (VoiceOver, NVDA, TalkBack) has not been checked by a person. The roles, names and states the browser reports are checked by script; what is actually spoken is not.
- The build’s check is a warning, not a stop: a page can go out with one.
Evidence
Where it's used
| Where | For |
|---|---|
| Every page of every Somnia site | From the page templates; hand-built pages use the same classes. |
| Somnia CMS | Every page that isn’t a site’s own. |
What we saw, and what changed
| When | What we saw | What changed |
|---|---|---|
| Pages opened with an all-caps label above the heading. | The hero takes a breadcrumb, not a label, and the spacing, the print layout and the build’s check follow breadcrumb then heading (1.7.0). | |
| The Insights and Case studies lists were headed by a headline, not by their names. | They are titled "Insights" and "Case studies", with the old headlines as their opening sentences (1.7.0). |
From building and using it on real sites, each entry taken from the changelog or the build's own notes. This is observation by the studio and its clients, not research sessions with users.
What we don't know yet
- Nothing is known about whether people read the opening sentence.