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.
| Prop | Type |
|---|---|
fullWidth | boolean |
homepageHrefThe URL of the homepage. Defaults to the GOV.UK homepage. | string |
productNameProduct 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 |
containerClassNameClasses for the container, useful if you want to make the header fixed width. | string |
Header.Container
| Prop | Type |
|---|---|
fullWidth | boolean |
Header.HomepageLink
No props of its own. Other props are passed to the element it renders.
Header.Logo
No props of its own. Other props are passed to the element it renders.
Header.Logotype
| Prop | Type |
|---|---|
ariaLabelText | string |
Header.ProductName
No props of its own. Other props are passed to the element it renders.