Skip to main content

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock () or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites.

In-page navigation

The 'On this page' list, built at runtime from the headings in the body.

Turning it on

It is front matter, not a shortcode:

in_page_nav: true
in_page_nav_headings: "h2"

A shortcode can only render inside main, and this component has to be a sibling of main for the two to lay out side by side. Front matter is the only place the decision can be made in time.

Choosing which headings

USWDS scans h2 and h3 by default, which sweeps up headings that belong to components — a summary box’s h3 shows up as if it were a section of the document. On a page using components, narrow it to h2.

ParameterEffect
in_page_nav_headingswhich levels to scan
in_page_nav_titleheading above the list
in_page_nav_min_headingshide below this count

The list is built by JavaScript from the rendered headings, so with JS off there is no list — which is correct, because the headings themselves are still there and still in order.

example.gov

official website of the Example Parent Agency

Looking for U.S. government information and services?
Visit USA.gov