1. Component Guide
  2. Step by step navigation header
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.

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
} %>

With unique tracking (preview)

In order to identify the step by step navigation the component is part of, we need to track a unique ID of the navigation in Google Analytics. This ID should be the same across all pages that are linked from and are part of that navigation. Its value is included in any tracking events, specifically in dimension96. It refers to the ID of the step nav that the component links to.

<%= render "govuk_publishing_components/components/step_by_step_nav_header", {
  title: "With a tracking id",
  path: "#",
  tracking_id: "this-is-the-tracking-id"
} %>

With custom tracking (preview)

<%= render "govuk_publishing_components/components/step_by_step_nav_header", {
  title: "With a custom tracking",
  path: "#",
  tracking_category: "customTrackingCategoryClicked",
  tracking_action: "customTrackingAction",
  tracking_label: "customTrackingLabel",
  tracking_dimension: "customTrackingDimension",
  tracking_dimension_index: "23"
} %>

Without custom dimension (preview)

<%= render "govuk_publishing_components/components/step_by_step_nav_header", {
  title: "Without custom dimensions",
  path: "#",
  tracking_category: "customTrackingCategoryClicked",
  tracking_action: "customTrackingAction",
  tracking_label: "customTrackingLabel",
  tracking_dimension_enabled: false
} %>

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"
} %>