Skip to content

Molecules · Page header

Page header

The top of a screen. It holds the page’s one h1 (the main, level-1 heading), and can add an eyebrow, a description, a breadcrumb trail and the page’s own actions at the far edge.

Best for
The top of every screen: its one h1, with eyebrow, description, breadcrumbs and page actions.
Not for
A section inside a page: use SectionHeading.

This page as Markdown, a plain-text copy for a coding agent (an AI tool that writes code).

Examples

Title and description

Orders

Every order from the last 90 days, newest first.

Code
tsx
<PageHeader level={2} title="Orders" description="Every order from the last 90 days, newest first." />

With an eyebrow and actions

Operations

Inventory

Stock across both depots, counted at close of day.

Code
tsx
<PageHeader  level={2}  eyebrow="Operations"  title="Inventory"  description="Stock across both depots, counted at close of day."  actions={    <>      <Button variant="secondary">Export</Button>      <Button>Add replica</Button>    </>  }/>

Under a breadcrumb trail

Notifications

What we send, and where.

Code
tsx
<PageHeader  level={2}  breadcrumbs={    <Breadcrumbs      items={[        { label: 'Account', href: '#account' },        { label: 'Settings', href: '#settings' },        { label: 'Notifications' },      ]}    />  }  title="Notifications"  description="What we send, and where."  actions={<Button variant="secondary">Reset to defaults</Button>}/>

Anatomy

PartWhat it is
BreadcrumbsOptional. A Breadcrumbs trail above everything else, first in reading order.
EyebrowOptional. A small label: JetBrains Mono, 12px (pixels), semibold, uppercase, in text.muted. It's a paragraph above the h1 and isn't part of the heading's name.
TitleThe page’s h1. Oxanium, semibold, 24px, growing to 30px when the header gets 48rem or more of width (a rem is the base text size, usually 16px).
DescriptionOptional. 16px body text in text.secondary, with lines no longer than 64 characters.
ActionsOptional. The page’s own controls at the far edge, in a row with a 12px gap. The row drops under the title when it runs out of room.

Props

titlestring
Required. The page’s name, shown as its h1.
eyebrowReactNode
A short label above the title: the area the page belongs to.
descriptionReactNode
One or two sentences under the title.
actionsReactNode
The page’s own actions, usually one or two Buttons. The component lays out the row and its gap.
breadcrumbsReactNode
A Breadcrumbs element, drawn above the eyebrow.
idstring
Goes on the h1, not the wrapper, so main can point aria-labelledby at it. That ARIA (Accessible Rich Internet Applications) attribute lets the main area take its name from the heading.
level1 | 2Default 1
Use 2 only for a page-style header inside a page that already has its h1 (a pane, a tab panel). It looks the same either way.
classNamestring
Extra CSS classes, merged onto the outer element. When two Tailwind classes clash, the later one wins.
refRef<HTMLDivElement>
Passed through to the outer element.

Keyboard

KeysResult
TabMoves through the breadcrumb links, then the actions. The header itself never takes keyboard focus.

Do and don't

Do

  • Use one per screen, at the top, inside main.
  • Keep the eyebrow to the area’s name (“Operations”), and the title to the page’s.
  • Put the page’s primary action last in the actions row, so it lands at the far edge.
  • When the page has more than one landmark (a named region screen readers can jump to), give the h1 an id and use it to name main.

Don't

  • Don’t use it for a section inside a page. That’s a SectionHeading.
  • Don’t put the page’s filters or tabs in the actions slot. They belong to the content under it.
  • Don’t repeat the title in the eyebrow. The eyebrow names where the page sits, and the title names the page.
  • Don’t add a second h1 inside the description or the actions.

Wrong

tsx
<PageHeader level={2} title="Orders" />

Right

tsx
<PageHeader title="Orders" />

The examples on this page pass level={2} only because they sit inside this docs page, which has its own h1. A screen’s own header is its h1, so leave level out.

Wrong

tsx
<PageHeader title="Inventory" /><PageHeader title="Low stock" />

Right

tsx
<PageHeader title="Inventory" /><SectionHeading level={2} title="Low stock" />

A page has one h1. Every heading under it is a SectionHeading, at the level the page’s outline of headings needs.

Wrong

tsx
<PageHeader title="Inventory" breadcrumbs={[{ label: "Operations" }]} />

Right

tsx
<PageHeader title="Inventory" breadcrumbs={<Breadcrumbs items={[{ label: "Operations", href: "/ops" }, { label: "Inventory" }]} />} />

breadcrumbs is a slot, not an array. Pass a Breadcrumbs element, which keeps its own renderLink and maxItems.