Skip to main content

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

Confirmation

Asks the user to confirm an action that is hard or impossible to undo, such as signing out or deleting something, before the app does it. It slides up as a modal, with the question, what will happen, and a choice of going ahead or not.

From the app: Sign out, the confirmation opened from Settings.

When to use it

  • The user has asked to do something destructive or hard to undo, such as signing out, deleting data or removing an account.
  • The user needs to know what will happen before they go ahead.
  • There are exactly two choices: do it, or go back.

When not to use it

If Use instead
The action is easy to undo, or loses nothing, such as turning a setting on or off. Do it straight away, with no confirmation
The action has already happened, and the screen says so. Outcome
The screen explains something, and the user isn't choosing whether to go ahead. Information page
The user has more than two choices. Settings list, with a row for each choice

Example

Confirmation, in light and dark

Close Are you sure you want to delete your saved details? You’ll need to enter them again the next time you use this service. You cannot undo this. Delete saved details Cancel Close Are you sure you want to delete your saved details? You’ll need to enter them again the next time you use this service. You cannot undo this. Delete saved details Cancel

HTML

<govuk-app-screen background="modal">
  <govuk-app-nav-bar>
    <govuk-app-nav-bar-item icon="close" name="cancel">Close</govuk-app-nav-bar-item>
  </govuk-app-nav-bar>
  <govuk-app-heading level="1" size="title-1">Are you sure you want to delete your saved details?</govuk-app-heading>
  <govuk-app-text>You’ll need to enter them again the next time you use this service. You cannot undo this.</govuk-app-text>
  <govuk-app-button-stack slot="footer">
    <govuk-app-button variant="destructive" name="confirm">Delete saved details</govuk-app-button>
    <govuk-app-button variant="grouped-secondary" name="cancel">Cancel</govuk-app-button>
  </govuk-app-button-stack>
</govuk-app-screen>

Using it

  • Ask the question in the heading, and say in the text what will happen and whether it can be undone.
  • Say what the action does on its button, such as Sign out or Delete saved details, not Yes or Confirm.
  • Its buttons go nowhere of their own. The page listens for clicks on them, by name, confirm or cancel, and goes where the app would, as examples/settings/sign-out.html does. Add works to each button the page acts on.
  • On iOS it slides up as a sheet over the screen it was opened from. Put it in a govuk-app-sheet, with that screen behind it, to show that.

Components it uses

Sources

The app’s iOS and Android screens it was taken from
  • iOS: SignOutConfirmationView in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Views/SignOut/SignOutConfirmationView.swift at 3813aa2a
  • iOS: SignOutConfirmationCoordinator, which presents it as a sheet in govuk-once/govuk-mobile-ios-app/Production/govuk_ios/Coordinators/SignOutConfirmationCoordinator.swift at 3813aa2a
  • Android: SignOutScreen in govuk-once/govuk-mobile-android-app/feature/settings/src/main/kotlin/uk/gov/govuk/settings/ui/SignOutScreen.kt at ed6237d6
  • Figma: none linked yet