Layout header
The header provides the crown logo, product or service name and navigation
Requires the specification of the environment (development, integration, staging or production).
How it looks (preview) (preview all)
How to call this component
<%= render "govuk_publishing_components/components/layout_header", {
environment: "production"
} %>
GOV.UK Design System
This component incorporates components from the GOV.UK Design System:
Accessibility acceptance criteria
The component must:
- have a text contrast ratio higher than 4.5:1 against the background colour to meet WCAG AA
Images in the Header must:
- be presentational when linked to from accompanying text (crown icon).
Landmarks and Roles in the Header should:
- have a role of
banner
at the root of the component (<header>) (ARIA 1.1)
Links in the component must:
- accept focus
- be focusable with a keyboard
- be usable with a keyboard
- indicate when they have focus
- change in appearance when touched (in the touch-down state)
- change in appearance when hovered
- be usable with touch
- be usable with voice commands
- have visible text
- have meaningful text
Other examples
Staging environment (preview)
<%= render "govuk_publishing_components/components/layout_header", {
environment: "staging"
} %>
Integration environment (preview)
<%= render "govuk_publishing_components/components/layout_header", {
environment: "integration"
} %>
Development environment (preview)
<%= render "govuk_publishing_components/components/layout_header", {
environment: "development"
} %>
With product name (preview)
<%= render "govuk_publishing_components/components/layout_header", {
environment: "production",
product_name: "Product"
} %>
Full width (preview)
This is difficult to preview because the preview windows are constrained, but the header will stretch to the size of its container.
<%= render "govuk_publishing_components/components/layout_header", {
environment: "production",
full_width: true
} %>
No bottom border (preview)
This is useful for pages where a large full-width banner is the first thing to appear on the page, for example, the GOV.UK homepage
<%= render "govuk_publishing_components/components/layout_header", {
remove_bottom_border: true
} %>
With search bar (preview)
<%= render "govuk_publishing_components/components/layout_header", {
search: true
} %>
With custom logo link (preview)
The header logo links to root by default. This option allows us to override that in certain instances.
<%= render "govuk_publishing_components/components/layout_header", {
logo_link: "/account/home"
} %>