Skip to main content
Login

Sign in to access your account

Header - National Design System

The top of every page, which holds the top bar, the digital stamp panel and the main navigation.

Overview

The header holds three parts: the top bar, the digital stamp panel and the main navigation. It draws no box of its own. header has display: contents, so its parts sit in the page as if the header were not there.

The links at the end of the page belong in the Footer, and the links inside one section in the Side Menu.

Usage

The code shows the outer element of each part. Copy each part whole from its own page.

<header> <div class="nds-topbar nds-content-wrapper" role="region" aria-label="Top bar utilities" data-i18n-aria-label="topbar.top_bar_utilities"> <!-- The stamp tab, today's date, the time or the weather, and the dark mode button: ../ui-shell/topbar --> </div> <div id="nds-digital-stamp" class="nds-topbar-expander" role="region" aria-label="Digital government stamp" data-i18n-aria-label="digital-stamp.label" hidden> <!-- The stamp: ../ui-shell/digital-stamp --> </div> <nav class="nds-main-nav nds-content-wrapper" id="nds-main-nav" aria-label="Primary navigation" data-i18n-aria-label="main-nav.primary_navigation"> <!-- The brand, the links and the actions: ../ui-shell/main-nav --> </nav> </header>

Parts

Part Holds Required
header The three parts below Yes
.nds-topbar The top bar: the stamp tab, today’s date, the time or the weather, and the dark mode button. See Top Bar Yes, on a government site
#nds-digital-stamp The stamp, a top bar expander right after the top bar. The stamp tab opens it. See Digital Stamp Yes, with the stamp tab
nav.nds-main-nav The main navigation: the brand, the links, the dropdowns and the actions. See Main Navigation Yes

Built-in Features

  • Sticky Navigation

    The main navigation sticks to the top of the screen while the page scrolls, and the top bar scrolls away. The navigation sticks inside body, not inside the header, because the header has no box.

  • One Panel at a Time

    The stamp panel and the main navigation's menu close each other. When one opens, the other closes.

Best Practices

  • Style the parts, not the header. Background, padding, borders and the sticky position go on .nds-topbar and .nds-main-nav. Rules on header render nothing.
  • The display: contents rule hits every header element on the page, such as an article header in your own markup. Put that header’s styles on a child element, or use a div.
  • Use one header per page: the first element in body after the skip link. See Page Layout.
  • Keep the parts in the order of the Parts table. The stamp panel opens right below the top bar, and the main navigation comes last.
  • Leave the header out of a minimal page, such as sign in or a one-time code. See Page Layout.
Last Modified Date: 13/10/2026 - 12:21 AM
Was this page useful?
60% of users said Yes from 2843 Feedbacks