Masthead
Introduce users to your product or service.
Contents
<div class="x-govuk-masthead">
<div class="govuk-width-container">
<div class="govuk-phase-banner x-govuk-phase-banner--inverse">
<p class="govuk-phase-banner__content">
<strong class="govuk-tag govuk-phase-banner__content__tag x-govuk-tag--inverse">
Alpha
</strong>
<span class="govuk-phase-banner__text">
This is a new service
</span>
</p>
</div>
<nav class="govuk-breadcrumbs govuk-breadcrumbs--inverse" aria-label="Breadcrumb">
<ol class="govuk-breadcrumbs__list">
<li class="govuk-breadcrumbs__list-item">
<a class="govuk-breadcrumbs__link" href="/">Home</a>
</li>
</ol>
</nav>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<h1 class="x-govuk-masthead__title">
Design your service using GOV.UK styles, components and patterns
</h1>
<p class="x-govuk-masthead__description">
Use this design system to make your service consistent with GOV.UK. Learn from the research and experience of other service teams and avoid repeating work that’s already been done.
</p>
<a href="#" role="button" draggable="false" class="govuk-button govuk-button--inverse govuk-button--start" data-module="govuk-button">
Get started
<svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" aria-hidden="true" focusable="false">
<path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z" />
</svg>
</a>
</div>
</div>
</div>
</div>
{{ xGovukMasthead({
phaseBanner: {
text: "This is a new service"
},
breadcrumbs: {
items: [{
href: "/",
text: "Home"
}]
},
title: {
text: "Design your service using GOV.UK styles, components and patterns"
},
description: {
text: "Use this design system to make your service consistent with GOV.UK. Learn from the research and experience of other service teams and avoid repeating work that’s already been done."
},
startButton: {
href: "#"
}
}) }}
When to use this component
Use the masthead component on the landing page of non-transactional, product-orientated services.
Use this component to introduce users to your service and its primary benefits. Optionally provide a link to the primary call to action such as signing up or reading the instructions on how to get started.
How it works
The masthead uses your service’s brand colour (set using $govuk-brand-colour
) and can include:
- a phase banner
- breadcrumbs
- the product name or proposition
- a description of key benefits
- a call to action button
- a representative illustration
It should appear directly below the header, and take up the full width of the page.
To ensure there is no gap between the header and the masthead, create a modifier class to remove the bottom border from the header:
Contents
<style>
.app-header--no-border {
border-bottom: 0;
}
</style>
<header class="govuk-header app-header--no-border" data-module="govuk-header">
<div class="govuk-header__container govuk-width-container">
<div class="govuk-header__logo">
<a href="/" class="govuk-header__link govuk-header__link--homepage">
<svg
focusable="false"
role="img"
class="govuk-header__logotype"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 148 30"
height="30"
width="148"
aria-label="GOV.UK">
<title>GOV.UK</title>
<path d="M22.6 10.4c-1 .4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s-.1 2-1 2.4m-5.9 6.7c-.9.4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s-.1 2-1 2.4m10.8-3.7c-1 .4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s0 2-1 2.4m3.3 4.8c-1 .4-2-.1-2.4-1-.4-.9.1-2 1-2.4.9-.4 2 .1 2.4 1s-.1 2-1 2.4M17 4.7l2.3 1.2V2.5l-2.3.7-.2-.2.9-3h-3.4l.9 3-.2.2c-.1.1-2.3-.7-2.3-.7v3.4L15 4.7c.1.1.1.2.2.2l-1.3 4c-.1.2-.1.4-.1.6 0 1.1.8 2 1.9 2.2h.7c1-.2 1.9-1.1 1.9-2.1 0-.2 0-.4-.1-.6l-1.3-4c-.1-.2 0-.2.1-.3m-7.6 5.7c.9.4 2-.1 2.4-1 .4-.9-.1-2-1-2.4-.9-.4-2 .1-2.4 1s0 2 1 2.4m-5 3c.9.4 2-.1 2.4-1 .4-.9-.1-2-1-2.4-.9-.4-2 .1-2.4 1s.1 2 1 2.4m-3.2 4.8c.9.4 2-.1 2.4-1 .4-.9-.1-2-1-2.4-.9-.4-2 .1-2.4 1s0 2 1 2.4m14.8 11c4.4 0 8.6.3 12.3.8 1.1-4.5 2.4-7 3.7-8.8l-2.5-.9c.2 1.3.3 1.9 0 2.7-.4-.4-.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-13h4.1v13.6c0 1.2-.2 2.2-.6 3.1s-1 1.7-1.8 2.4c-.7.7-1.6 1.2-2.7 1.5-1 .4-2.2.5-3.4.5-1.2 0-2.4-.2-3.4-.5-1-.4-1.9-.9-2.7-1.5-.8-.7-1.3-1.5-1.8-2.4-.4-.9-.6-2-.6-3.1V6.9h4.2v13c0 .8.1 1.4.3 2 .2.6.5 1 .9 1.4.4.4.8.6 1.4.8.6.2 1.1.3 1.8.3zm13-17.4h4.2v9.1l7.4-9.1h5.2l-7.2 8.4L148 28h-4.9l-5.5-9.4-2.7 3V28h-4.2V7zm-27.6 16.1c-1.5 0-2.7 1.2-2.7 2.7s1.2 2.7 2.7 2.7 2.7-1.2 2.7-2.7-1.2-2.7-2.7-2.7z"></path>
</svg>
</a>
</div>
</div>
</header>
<div class="x-govuk-masthead x-govuk-masthead--large">
<div class="govuk-width-container">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<h1 class="x-govuk-masthead__title">
Design your service using GOV.UK styles, components and patterns
</h1>
<p class="x-govuk-masthead__description">
Use this design system to make your service consistent with GOV.UK. Learn from the research and experience of other service teams and avoid repeating work that’s already been done.
</p>
<a href="#" role="button" draggable="false" class="govuk-button govuk-button--inverse govuk-button--start" data-module="govuk-button">
Get started
<svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" aria-hidden="true" focusable="false">
<path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z" />
</svg>
</a>
</div>
</div>
</div>
</div>
<style>
.app-header--no-border {
border-bottom: 0;
}
</style>
{{ govukHeader({
classes: "app-header–no-border"
}) }}
{{ xGovukMasthead({
classes: "x-govuk-masthead–large",
title: {
text: "Design your service using GOV.UK styles, components and patterns"
},
description: {
text: "Use this design system to make your service consistent with GOV.UK. Learn from the research and experience of other service teams and avoid repeating work that’s already been done."
},
startButton: {
href: "#"
}
}) }}
If your service uses the primary navigation component, this should appear directly above the masthead:
You can use HTML or, if you are using Nunjucks or the GOV.UK Prototype Kit, you can use the Nunjucks macro.
Nunjucks macro options
Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.
Some options are required for the macro to work; these are marked as “Required” in the option description.
If you’re using Nunjucks macros in production with html
options, or ones ending with html
, you must sanitise the HTML to protect against cross-site scripting exploits.
Name | Type | Description |
---|---|---|
title | object | Title text shown in the masthead. See title. |
description | object | Short description text shown below the title. See description. |
startButton | object | Options for start button. See startButton. |
image | object | Options for image displayed on the right of the masthead on desktop layouts. See image. |
phaseBanner | object | Options for the phase banner component. See phase banner component in the GOV.UK Design System. |
breadcrumbs | object | Options for the breadcrumbs component. See breadcrumbs component in the GOV.UK Design System. |
caller | nunjucks-block | Not strictly a parameter but Nunjucks code convention. Using a |
classes | string | Classes to add to the masthead container. |
attributes | object | HTML attributes (for example data attributes) to add to the navigation container. |
Name | Type | Description |
---|---|---|
text | string | The title text that displays in the masthead. You can use any string with this option. If you set |
html | string | The title HTML that displays in the masthead. You can use any string with this option. Use this option to set text that contains HTML. If you set |
Name | Type | Description |
---|---|---|
text | string | The description text that displays in the masthead. You can use any string with this option. If you set |
html | string | The description HTML that displays in the masthead. You can use any string with this option. Use this option to set text that contains HTML. If you set |
Name | Type | Description |
---|---|---|
text | string | Required. If |
html | string | Required. If |
name | string | Name for the |
type | string | Type of |
href | string | The URL that the button should link to. If this is set, element will be automatically set to |
classes | string | Classes to add to the button component. |
attributes | object | HTML attributes (for example data attributes) to add to the button component. |
Name | Type | Description |
---|---|---|
src | string | Required. URL for the masthead image. |
alt | string | Alternative text for masthead image. |
Research on this component
This component is based on the Masthead component used in the Product Page Example. This in turn was based on the product pages for:
Versions of this component are currently being used on these services:
- Ethnicity facts and figures
- Find a Learning Aim
- Find planning and housing data in England
- Gender pay gap service
- HMRC Developer Hub
- Register trainee teachers
Known issues
It’s currently not possible to place this component within the main
element when using the default Nunjucks template. If you are able to update your application’s layout, you should adjust it so that the main
element encapsulates this component.