Component

Step by step navigation header

Shows that a content page is part of a step by step navigation

The component indicates to the user that the current page is part of a step by step navigation, and can provide a link to it.

Search for usage of this component on GitHub.

How it looks (preview) (preview all)

Part of Learn to drive a car: step by step

How to call this component

<%= render "govuk_publishing_components/components/step_by_step_nav_header", {
  title: "Learn to drive a car: step by step"
} %>

Accessibility acceptance criteria

The component is designed to go into the top of an existing content page. This component looks like a heading so uses a heading level 2 element.

An earlier version of the component did not use a heading element – this failed WCAG 2.1 Success Criterion 1.3.1 (“Information, structure, and relationships conveyed through presentation can be programmatically determined or are available in text.”)

An early version of the component contained a hidden skip link for keyboard and screen reader users, that jumped to the step by step navigation component in the sidebar (similar to the ‘skip to content’ link at the top of all GOV.UK pages). User testing suggested that rather than helping users it confused them, so this has been removed.

Always place the step by step navigation header at the top of a page, before the <main> element. Placing the component here means that the “Skip to main content” link allows the user to skip all navigation links, including the step by step navigation header.

Links in the component must:

  • accept focus
  • be focusable with a keyboard
  • be usable with a keyboard
  • indicate when they have focus
  • change in appearance when touched (in the touch-down state)
  • change in appearance when hovered
  • be usable with touch
  • be usable with voice commands
  • have visible text
  • have meaningful text

Other examples

With a long text (preview)

<%= render "govuk_publishing_components/components/step_by_step_nav_header", {
  title: "Coronavirus: businesses and self-employed people",
  path: "/childcare-parenting/pregnancy-and-birth"
} %>

With margin bottom (preview)

The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the GOV.UK Frontend spacing scale. It defaults to having a margin bottom of 30px.

Part of Learn to practice flexible spacing: step by step
<%= render "govuk_publishing_components/components/step_by_step_nav_header", {
  title: "Learn to practice flexible spacing: step by step",
  margin_bottom: 9
} %>

Without ga4 tracking (preview)

Disables GA4 tracking on the header. Tracking is enabled by default. This includes the ga4-link-tracker module and data-ga4-link attributes. See the ga4-link-tracker docs for more information.

<%= render "govuk_publishing_components/components/step_by_step_nav_header", {
  disable_ga4: true,
  title: "Learn to drive a motorbike: step by step",
  path: "/learn-to-drive-a-motorbike"
} %>