Skip to main content

These components are for prototyping the GOV.UK app, not for use in production.

<govuk-app-banner>

Banner

Tells the user something they should know now, on the screen it's about: an alert on Home, such as an emergency, or a warning, such as that driving without tax can invalidate their insurance. It can have a link to find out more, and can be closed.

GOV.UK app component

Proposed: the warning

The yellow warning comes from the future driving designs, not the app, which we have only as a screenshot for now. It may change, or never ship, and its sizes are approximate. Its yellow is GovKit’s yellowTint80, as in the designs. They show only light mode, so in dark mode it’s the app’s own dark pair for that yellow, from its state label: dark blue, with yellow text.

The designs’ icon is a steering wheel with a warning sign, which Material Symbols doesn’t have; warning is the closest.

Known differences from the app

  • Closing a banner hides it straight away: the app’s fades out.

Examples

Information

Test on Sunday 7 September, 3pm Test on Sunday 7 September, 3pm

HTML

<govuk-app-banner title="Emergency alerts" dismissible name="emergency-alerts-test" link="More information" href="https://www.gov.uk/alerts">
  Test on Sunday 7 September, 3pm
</govuk-app-banner>

Local emergency

This is a level 2 incident. If this was a level 1 incident, it would be red This is a level 2 incident. If this was a level 1 incident, it would be red

HTML

<govuk-app-banner type="local-emergency" title="Local emergency" dismissible link="More information" href="https://www.gov.uk/alerts">
  This is a level 2 incident. If this was a level 1 incident, it would be red
</govuk-app-banner>

National emergency, which can't be closed

This is a level 1 incident This is a level 1 incident

HTML

<govuk-app-banner type="national-emergency" title="National emergency" link="More information" href="https://www.gov.uk/alerts">
  This is a level 1 incident
</govuk-app-banner>

Proposed: a warning

Driving without vehicle tax can invalidate your insurance Driving without vehicle tax can invalidate your insurance

HTML

<govuk-app-banner type="warning" icon="warning" title="Stay insured" dismissible name="stay-insured">
  Driving without vehicle tax can invalidate your insurance
</govuk-app-banner>

Inputs

Attributes
Attribute Type Default Description
type "information" | "local-emergency" | "national-emergency" | "notable-death" | "warning" information information: white, or blue in dark mode, with a pale blue border. local-emergency: teal. national-emergency: red. notable-death: black. warning, proposed: yellow, with an icon and smaller type, as the future driving designs' Stay insured.
title string Its title, in bold, such as Emergency alerts. The app's banners can be without one.
level "2" | "3" | "4" 2 The title's place in the screen's outline. Drawn as h2 to h4.
dismissible boolean false Shows a button to close it, which hides it. The app's national emergencies can't be closed.
link string Text for a link below, such as More information.
href string Where the link goes.
name string Tells the banner apart when it's closed: its close button's value.
icon string For a warning, the name of a Material Symbol on its left, such as warning.

Content

What it says, a sentence or two.

Outputs

  • click: From its close button, named dismiss, with the banner's name as its value, when it's closed; the banner hides itself. From its link, which goes to its page.

Rules

  • Use a banner for something the user should know now, about the screen it's on. Don't use it for something they must act on to carry on: put that in the screen itself.
  • Use the emergency types only for the app's emergency alerts, as on Home, and only one at a time.
  • Keep what it says to a sentence or two, with a link to find out more.
  • Let it be closed unless it's an emergency the user must see, as the app's national emergencies can't be.
  • Use warning, which is proposed, for a warning about something on the screen, such as Stay insured on a vehicle with no tax.

When not to use it

When Use instead
For something the user must do before they can carry on Say it in the screen itself, in its heading and text, with a button to do it.
For how something with a deadline stands, such as a vehicle's tax govuk-app-status
For one card that needs attention, such as an expired licence govuk-app-card-header
To confirm something worked, such as signing out A screen of its own, with a centred govuk-app-heading size="large-title".
For a few points that are read together govuk-app-bulleted-list

Sources

The iOS, Android and Figma sources it was built from
  • iOS: EmergencyBannerWidgetView in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/Home/EmergencyBannerWidgetView.swift at 8f1fe5da
  • iOS: its colours, by type in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/ViewModels/EmergencyBannerWidgetViewModel.swift at 8f1fe5da
  • iOS: stateLabelErrorBackgroundColor, stateLabelErrorForegroundColor: the warning's dark mode in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Extensions/GovKit/GOVUKColors+DVLA.swift at 8f1fe5da
  • Figma: none linked yet

In the app

Screenshots of the app's own component, to compare the examples with

iOS

iOS app: Information, with a link, in light mode
Information, with a link, in light mode
iOS app: Information, in dark mode
Information, in dark mode
iOS app: Local emergency
Local emergency
iOS app: National emergency, which can't be closed
National emergency, which can't be closed