Skip to main content

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

<govuk-app-screen>

Screen

Lays out one screen of the app: the navigation bar at the top, the content, which scrolls, and the tab bar or a button stack at the bottom. Write a screen's components inside it in order, top to bottom.

Native component

Writing a screen

Write a screen’s components inside it in the order they appear, top to bottom. The screen sorts them into place:

  • a <govuk-app-nav-bar>, or the home screen’s <govuk-app-home-header>, goes at the top, and stays there as the content scrolls under it
  • a <govuk-app-tab-bar> goes at the bottom, and floats over the content
  • anything with slot="footer", usually a <govuk-app-button-stack>, is pinned below the content. On a screen with a tab bar too, such as GOV.UK Chat with its <govuk-app-chat-input>, the tab bar goes below the footer
  • everything else is the content, which scrolls
<govuk-app>
  <govuk-app-screen background="modal">
    <govuk-app-nav-bar title="Sign out"></govuk-app-nav-bar>
    <p>If you’re using Face ID or Touch ID to unlock the app, this will be turned off.</p>
    <govuk-app-button-stack slot="footer">
      <govuk-app-button variant="destructive" name="sign-out">Sign out</govuk-app-button>
      <govuk-app-button variant="grouped-secondary" name="cancel">Cancel</govuk-app-button>
    </govuk-app-button-stack>
  </govuk-app-screen>
</govuk-app>

Its size

The screen fills its <govuk-app>, so give the root a size, such as a phone’s: 402px by 874px for an iPhone 17 Pro. On a page that is the screen, give it the page’s full height instead.

If the status bar and home indicator are drawn over the screen, rather than above and below it, leave room for them on the root. The content starts below the status bar, and a button stack’s buttons end above the home indicator:

govuk-app {
  --govuk-app-inset-top: 62px;
  --govuk-app-inset-bottom: 34px;
}

Known differences from the app

  • The app’s screens each set their own spacing. The content here is always 16pt from the edges and 16pt apart, which is the commonest; a component’s own margins add to it.

Examples

A modal screen with buttons

If you’re using Face ID or Touch ID to unlock the app, this will be turned off. You can turn it on again the next time you sign in.

Sign out Cancel

If you’re using Face ID or Touch ID to unlock the app, this will be turned off. You can turn it on again the next time you sign in.

Sign out Cancel

HTML

<govuk-app-screen background="modal">
  <p>If you’re using Face ID or Touch ID to unlock the app, this will be turned off. You can turn it on again the next time you sign in.</p>
  <govuk-app-button-stack slot="footer">
    <govuk-app-button variant="destructive" name="sign-out">Sign out</govuk-app-button>
    <govuk-app-button variant="grouped-secondary" name="cancel">Cancel</govuk-app-button>
  </govuk-app-button-stack>
</govuk-app-screen>

A page with a navigation bar and tab bar

Notifications

Face ID

Your accounts

Privacy notice. Accessibility statement. Open source licences. Terms and conditions. Help using the app.

Home Settings

Notifications

Face ID

Your accounts

Privacy notice. Accessibility statement. Open source licences. Terms and conditions. Help using the app.

Home Settings

HTML

<govuk-app-screen>
  <govuk-app-nav-bar title="Settings" large-title></govuk-app-nav-bar>
  <p>Notifications</p>
  <p>Face ID</p>
  <p>Your accounts</p>
  <p>Privacy notice. Accessibility statement. Open source licences. Terms and conditions. Help using the app.</p>
  <govuk-app-tab-bar>
    <govuk-app-tab-bar-item icon="home" name="home">Home</govuk-app-tab-bar-item>
    <govuk-app-tab-bar-item icon="settings" name="settings" selected>Settings</govuk-app-tab-bar-item>
  </govuk-app-tab-bar>
</govuk-app-screen>

A page pushed on top, with a button

We store a small amount of data about you to improve your experience in the app.

You can ask for a copy of it.

Request your data

We store a small amount of data about you to improve your experience in the app.

You can ask for a copy of it.

Request your data

HTML

<govuk-app-screen>
  <govuk-app-nav-bar title="Your app data" back></govuk-app-nav-bar>
  <p>We store a small amount of data about you to improve your experience in the app.</p>
  <p>You can ask for a copy of it.</p>
  <govuk-app-button-stack slot="footer">
    <govuk-app-button name="request">Request your data</govuk-app-button>
  </govuk-app-button-stack>
</govuk-app-screen>

Inputs

Attributes
Attribute Type Default Description
background "page" | "modal" | "green" | "chat" page page: the app's pale blue, for screens in its sections. modal: white, for a screen presented over them, such as a question or a confirmation. green: the app's green, the same in light and dark, with white text and its content set further down, for a screen that takes over the app, in a full-screen cover. chat: GOV.UK Chat's, the same pale blue, with its conversation kept below the status bar and above the chat input, rather than scrolling under them, as the app's chat screen does.

Content

The screen's components, top to bottom. A <govuk-app-nav-bar>, or the home screen's <govuk-app-home-header>, goes at the top and sticks there. A <govuk-app-tab-bar> goes at the bottom of the content and floats over it. An element with slot="footer", usually a <govuk-app-button-stack>, is pinned below the content, with the tab bar below it if there is one, as GOV.UK Chat's field is. Everything else is the content, 16pt in from the sides and 16pt apart, and scrolls.

Outputs

None.

Rules

  • Put a screen directly in a <govuk-app>, and give the root a size: the screen fills it, and scrolls inside it.
  • Use one screen for each screen of a journey. In a prototype of several pages, put each on its own page.
  • Give a screen either a tab bar or a button stack, not both: the app hides the tab bar on screens that ask the user to act. GOV.UK Chat's field is the one footer the app shows above its tab bar.
  • Use the modal background for screens presented over the app, such as a sign-out confirmation, and the page background for the rest.
  • Use the green background only for a screen that takes over the app, in a full-screen cover, as the app does when adding a driver and vehicles account. Give it a black button.
  • Use the chat background for GOV.UK Chat's screens, with a chat input in its footer.

When not to use it

When Use instead
For a task over the screen the user was on, such as signing out A govuk-app-sheet, with the screen inside it.
For a journey that takes over the app until it's done A govuk-app-full-screen-cover, with the screen inside it.
For a part of a screen govuk-app-section

Sources

The iOS, Android and Figma sources it was built from
  • iOS: SignOutConfirmationView in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/SignOut/SignOutConfirmationView.swift at 1e520fc1
  • iOS: SARExplainerView in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/SwiftUIViews/Settings/SARExplainerView.swift at 1e520fc1
  • iOS: fills.surfaceBackground, fills.surfaceModal in govuk-once/govuk-mobile-ios-gov-kit/GovKitUI/Sources/Colors/GOVUKColors+Fills.swift at 8a7641e
  • iOS: ServiceAccountConsentView, on fills.surfaceFullScreenLinkAccount in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/ServiceAccount/ServiceAccountConsentView.swift at fc2b3b1d
  • iOS: ChatView, its scroll view's padding in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/Chat/ChatView.swift at fc2b3b1d
  • Figma: none linked yet
  • The app prototyping system's viewer, whose screen this follows (app-prototyping-system, exploration-2/viewer/css/app.css)

In the app

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

iOS

iOS app: Sign out confirmation: a modal screen, in light mode
Sign out confirmation: a modal screen, in light mode
iOS app: Sign out confirmation, in dark mode
Sign out confirmation, in dark mode
iOS app: Analytics consent: a longer modal screen
Analytics consent: a longer modal screen