Confirmation dialog

v3.0

Confirmation dialogs ask users to confirm a potentially destructive action, a high-impact decision, or accept or reject terms.

Stylized graphic of a set of dialogs.

Anatomy

A confirmation dialog with 4 elements numbered: 1. Container, 2. Header, 3. Body, 4. Buttons
  1. Container
  2. Header
  3. Body
  4. Buttons

Properties

Title

The title is required and frames the decision the user needs to make. A strong title is specific about the action being confirmed and often posed as a question.

  • Use sentence case
  • Keep to 1 line
  • Frame as a question when possible
  • Don’t use ending punctuation, unless it’s a proper sentence like a question
A confirmation dialog with a title of “delete address”.

Body

The body is required and explains what will happen if the user confirms or rejects. A strong body clearly states the consequences, especially for destructive or irreversible actions, and includes specific details.

  • Keep to 1-3 sentences
  • Avoid repeating the header
A confirmation dialog with a body of “it will be permanently removed.”

Buttons

Confirmation and cancel buttons are required. Selecting one of the two actions is the only way to dismiss the dialog.

The primary action button confirms and executes the action, so the label should clearly describe user’s action.

  • Use sentence case
  • Keep to 1-3 words
  • Avoid generic labels like "Yes" or "OK"

The cancel button dismisses the dialog without taking action. Common labels for cancel buttons are “Cancel” and “Go back”.

  • Use sentence case
  • Keep to 1-2 words
  • Avoid "No" unless the title is a clear yes/no question

See Buttons for more details on visual hierarchy and writing guidance.

A confirmation dialog with a primary button of “confirm” and a borderless button of “cancel”.

Scrim

The scrim is a semi-transparent overlay that focuses attention on the dialog. The scrim isn’t interactive and doesn’t dismiss the dialog.

Dialog over a scrim that darkens and separates the dialog from the elements behind it.

Behavior

Presentation

Confirmation dialogs fade in and out from the center of the screen.

Confirmation dialogs are commonly triggered by a user action, like deleting a record. However, the application can trigger a confirmation dialog to appear to inform the user of an important update that requires their attention.

Dismissing

Confirmation dialogs can be dismissed by clicking either the confirmation or cancellation action. Pressing the escape key on a keyboard will register as the cancellation action.

A confirmation dialog with a title of “delete messages”, a body of “2 messages with be permanently deleted”, a primary button of “delete” and a borderless button of “cancel”.

Button placement

The alert dialog button is positioned along the trailing edge of the dialog container below the body content.

The alert dialog button is positioned along the trailing edge of the dialog container below the body content.

Width & height

Confirmation dialogs are a fixed width to maintain readability and encourage short, simple messaging. They flex vertically to fit their content down to a maximum height of 400px.

A confirmation dialog with a title of “Exclude carrier”, a body of “Changes will be applied to all active Simple Delivery listings”, a primary button of “exclude” and a borderless button of “cancel”.

Screen sizes

Small screen

Alert dialogs on small screens are centered.

A centered confirmation dialog on a small screen.

Large screen

Confirmation dialogs on large screens are centered and inset as well.

A centered confirmation dialog on a large screen.

Best practices

Scrolling

Do ensure confirmation dialogs do not scroll.

A confirmation dialog not scrolling.

Don’t pack confirmation dialogs with content that would cause it to flex beyond the maximum height or scroll.

A scrolling confirmation dialog.

Critical messaging

Do use confirmation dialogs when informing a user of a decision’s impact. These dialogs present two actions and are dismissed by interacting with one of them.

A confirmation dialog with a title of “Turn off notifications?”, a body of “You won’t receive alerts for this channel until notifications are re-enabled”, a primary button  of “Turn off” and a borderless button of “cancel”.

Don’t use a confirmation dialog when an alert is triggerd by the system.

A confirmation dialog with a title of “Updated privacy policy”, a body of “We’ve made changes to our privacy policy. By continuing, you’re agreeing to the new policy. ”, a primary button of “Accept”.

Actions

Do utilize CTA buttons to direct user to interact before dialog is dismissed.

A confirmation dialog with a primary and borderless button.

Don’t show confirmation dialogs without CTA buttons.

A confirmation dialog with no buttons.

Types of buttons

Do always use a primary button with a borderless button

A confirmation dialog showing a primary and borderless button.

Don’t use secondary or tertiary buttons.

A confirmation dialog showing a secondary and tertiary button.

Alignment

Do always center-align alert and confirm dialogs.

A centered confirmation dialog on a small screen.

Don’t bottom-align alert and confirm dialogs.

A confirmation dialog bottom-aligned on a small screen.

Specs

A spec for a confirmation dialog container. The container has 16px of padding on all sides. 8px of padding is between the title and body copy. 16px of padding is between body copy and button group. 8px of padding is between the buttons.

Confirm dialog