Composite · Navigation Stable

Page header

Which page is this, how do I go back up, and what can I do here?

1 variant × 1 state · 1 toggle
Path
Home › Projects › Spring launch (sample)
Page actions
Filter, New task (sample)

The header of a list or detail page: the crumb before the current page is the one link up. Turn on With switch for a segmented control among the actions, and narrow the frame to see the actions wrap under the path.

Prompt to build this component

When to use it

When to use

  • At the top of the main column of every signed-in product screen, beside cmp-sidebar-nav.
  • On list and detail pages: the breadcrumb from the top level to this page, and the page's actions on the right.
  • On phone-width product screens, alone, as the only navigation: its last crumb link is the way up.

When not to use

  • On public pages: use cmp-site-header.
  • As a page title block with a lede: put the title in the page body with the typography display classes.
  • For tabs that switch between sibling pages: those are separate destinations in cmp-sidebar-nav.
  • For a list of every step in a flow: use cmp-step-list, in a side panel.
Variants, anatomy, accessibility, interaction and content rules

Variants

Not applicable: one look. The breadcrumb on the left and the page actions on the right, on the page surface with a hairline below.

Anatomy

Built from:

  • cmp-button, variants primary and secondary — page actions, at most one primary.
  • cmp-segmented-control, the base variant — an optional switch (with-switch), such as a layout switch on a list page. Its radio name is unique on the page.

Own parts:

  • Root: <header class="ds-page-header">.
  • ds-page-header__trail: a <nav aria-label="Breadcrumb"> holding ds-page-header__crumbs, an <ol> with one <li> per level. Every crumb but the last is a link; the last <li> carries aria-current="page". A "›" separator is drawn between crumbs.
  • ds-page-header__actions: the right-hand group of controls.

Accessibility

  • The breadcrumb is a nav landmark named "Breadcrumb" with an ordered list; the current page is marked with aria-current="page" and is not a link.
  • Separators are drawn by CSS, so screen readers do not announce them.
  • The switch is a radio group with an aria-label ("Layout"); arrow keys move between its options.
  • The page's h1 sits in the page body, not in the header.

Interaction

  • Crumb links, buttons and the switch answer hover and press within the quick duration with a colour change only (int-01, int-03).
  • Choosing an option of the switch keeps focus on it (int-02).
  • The header never animates in or out, and stays still under reduced motion (int-04, int-06).
  • The current crumb ([aria-current]) is drawn in the default text colour from the start (instant: it is set with the page and never changes in place).

Content rules

  • Crumbs use each page's own title, shortened only when it is longer than about 30 characters.
  • Action labels are a verb and an object ("New task", "Copy prompt"); view controls may be nouns ("Settings").

Do and don't

  • Do keep the path complete from the top level, so the crumb before the current page is always the one way up.
  • Do place the primary action last, at the right edge.
  • Don't put more than one primary button or a second row of tabs in the header.
  • Don't hide the breadcrumb on desktop screens; on narrow screens let the actions wrap below it.