Components

Phase banner

Use the phase banner component to show users your service is still being worked on.

WCAG 2.2

New WCAG 2.2 criteria affects this component

To use the ‘Phase banner’ and meet the new Web Content Accessibility Guidelines (WCAG) 2.2 criteria, make sure that users can successfully:

See the full list of components and patterns affected by WCAG 2.2.

<div class="govuk-phase-banner">
  <p class="govuk-phase-banner__content">
    <strong class="govuk-tag govuk-phase-banner__content__tag">
      Alpha
    </strong>
    <span class="govuk-phase-banner__text">
      This is a new service. Help us improve it and <a class="govuk-link" href="#">give your feedback by email</a>.
    </span>
  </p>
</div>
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.

Primary options
Name Type Description
text string Required. If html is set, this is not required. Text to use within the phase banner. If html is provided, the text option will be ignored.
html string Required. If text is set, this is not required. HTML to use within the phase banner. If html is provided, the text option will be ignored.
tag object Required. The tag used by the phase banner component. See tag.
classes string Classes to add to the phase banner container.
attributes object HTML attributes (for example data attributes) to add to the phase banner container.
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner %}

{{ govukPhaseBanner({
  tag: {
    text: "Alpha"
  },
  html: 'This is a new service. Help us improve it and <a class="govuk-link" href="#">give your feedback by email</a>.'
}) }}

When to use this component

Services hosted on a service.gov.uk domain must use the phase banner until they pass a live assessment.

How it works

There are 2 ways to use the phase banner component. You can use HTML or, if you are using Nunjucks or the GOV.UK Prototype Kit, you can use the Nunjucks macro.

Use an alpha banner when your service is in alpha, and a beta banner if your service is in private or public beta.

Your banner must be directly under the black GOV.UK header and colour bar.

WCAG 2.2

Do not make the phase banner ‘sticky’ to the top of the page by using `position: fixed` or any other method. This is to make sure it does not cover or obscure any content which has a focus applied. This is to comply with WCAG 2.2 success criterion 2.4.11 Focus not Obscured (minimum).

Use a ‘feedback’ link to collect on-page feedback about your service. This can open an email or take the user to a dedicated page or form.

<div class="govuk-phase-banner">
  <p class="govuk-phase-banner__content">
    <strong class="govuk-tag govuk-phase-banner__content__tag">
      Alpha
    </strong>
    <span class="govuk-phase-banner__text">
      This is a new service. Help us improve it and <a class="govuk-link" href="#">give your feedback by email</a>.
    </span>
  </p>
</div>
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.

Primary options
Name Type Description
text string Required. If html is set, this is not required. Text to use within the phase banner. If html is provided, the text option will be ignored.
html string Required. If text is set, this is not required. HTML to use within the phase banner. If html is provided, the text option will be ignored.
tag object Required. The tag used by the phase banner component. See tag.
classes string Classes to add to the phase banner container.
attributes object HTML attributes (for example data attributes) to add to the phase banner container.
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner %}

{{ govukPhaseBanner({
  tag: {
    text: "Alpha"
  },
  html: 'This is a new service. Help us improve it and <a class="govuk-link" href="#">give your feedback by email</a>.'
}) }}
<div class="govuk-phase-banner">
  <p class="govuk-phase-banner__content">
    <strong class="govuk-tag govuk-phase-banner__content__tag">
      Beta
    </strong>
    <span class="govuk-phase-banner__text">
      This is a new service. Help us improve it and <a class="govuk-link" href="#">give your feedback (opens in new tab)</a>.
    </span>
  </p>
</div>
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.

Primary options
Name Type Description
text string Required. If html is set, this is not required. Text to use within the phase banner. If html is provided, the text option will be ignored.
html string Required. If text is set, this is not required. HTML to use within the phase banner. If html is provided, the text option will be ignored.
tag object Required. The tag used by the phase banner component. See tag.
classes string Classes to add to the phase banner container.
attributes object HTML attributes (for example data attributes) to add to the phase banner container.
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner %}

{{ govukPhaseBanner({
  tag: {
    text: "Beta"
  },
  html: 'This is a new service. Help us improve it and <a class="govuk-link" href="#">give your feedback (opens in new tab)</a>.'
}) }}

Whatever option you use, make sure that users do not lose their place in the service and can return to the page they were on.

Find out what feedback you need to collect at each phase in the GOV.UK Service Manual.

Help improve this component

To help make sure that this page is useful, relevant and up to date, you can:

Tell us if your service uses this component

Take part in our usage survey (opens in a new tab) to help us improve this component to better meet the needs of the services that use it.

Need help?

If you’ve got a question about the GOV.UK Design System, contact the team.