Skip to main content
Components

Generic header

A generic header to help services not on GOV.UK.

Children are the logo.

Import

import * as GenericHeader from 'govuk-react/generic-header';

Examples

Default

Code
<GenericHeader.Root>
  <GenericHeader.Container>
    <GenericHeader.Logo>
      <GenericHeader.HomepageLink href="#">
        <svg width="28" height="30" viewBox="0 0 28 30" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
          <circle cx="13.5549" cy="4.21349" r="4.21349" />
          <circle cx="13.5549" cy="25.7865" r="4.21349" />
          <circle cx="22.8963" cy="9.6068" r="4.21349" />
          <circle cx="4.2135" cy="20.3932" r="4.21349" />
          <circle cx="22.8963" cy="20.3932" r="4.21349" />
          <circle cx="4.21351" cy="9.60674" r="4.21349" />
        </svg>{' '}
        Service name
      </GenericHeader.HomepageLink>
    </GenericHeader.Logo>
  </GenericHeader.Container>
</GenericHeader.Root>

API reference

GenericHeader.Root

A generic header to help services not on GOV.UK.

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

GenericHeader.Composite

A generic header to help services not on GOV.UK.

Children are the logo.

PropType
fullWidthboolean
homepageHref

The URL of the logo link. Defaults to the root of the current web domain ("/").

string
containerClassName

Classes for the container. Useful if you want to make the Generic header fixed width.

string

GenericHeader.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.