Skip to main content
Components

Header

The GOV.UK header shows users that they are on GOV.UK.

Read the Design System guidance for header

Import

import * as Header from 'govuk-react/header';

Examples

Default

Code
<Header.Root>
  <Header.Container>
    <Header.Logo>
      <Header.HomepageLink href="#">
        <Header.Logotype />
      </Header.HomepageLink>
    </Header.Logo>
  </Header.Container>
</Header.Root>

API reference

Header.Root

The GOV.UK header shows users that they are on GOV.UK.

No props of its own. Other props are passed to the element it renders.

Header.Composite

The GOV.UK header shows users that they are on GOV.UK.

PropType
fullWidthboolean
homepageHref

The URL of the homepage. Defaults to the GOV.UK homepage.

string
productName

Product name, used when the product name follows on directly from ‘GOV.UK’. For example, GOV.UK Pay or GOV.UK Design System. In most circumstances, you should use the Service navigation component.

ReactNode
containerClassName

Classes for the container, useful if you want to make the header fixed width.

string

Header.Container

PropType
fullWidthboolean

No props of its own. Other props are passed to the element it renders.

No props of its own. Other props are passed to the element it renders.

Header.Logotype

PropType
ariaLabelTextstring

Header.ProductName

No props of its own. Other props are passed to the element it renders.