Library / Interaction & UX patterns / Confirmation dialog
No. 143·noun·also called are you sure prompt, confirm dialog, delete confirmation

Confirmation dialog

A small pop-up that stops you before something serious happens and asks you to confirm or cancel.

SPECIMEN · DIAGRAM · ANATOMY
Title: Delete project?
What will be lost
Cancel
Delete project1
1Button repeats the action
Definition

What it is

A confirmation dialog is a short question that appears after someone clicks a risky button, such as Delete, Cancel subscription, or Send to everyone. It names what is about to happen and gives two choices: go ahead, or back out.

Use it when an action is hard or impossible to reverse, or when it affects other people. Good ones say exactly what will be lost ("Delete the project 'Spring launch'?") and label the button with the action ("Delete project"), not a vague "Yes" or "OK".

Don't put one on everything. If you ask on every click, people stop reading and just press the button. For small actions you can undo, skip the question and offer Undo instead.

A confirmation dialog is a specific use of a modal. The modal is the box; the confirmation is the job it does.

Say it like a builder

How to ask for it

Vague

“I don't want people to delete their projects by accident. Can you add something?”

Precise

“Add a confirmation dialog when someone clicks Delete project. Show the project name, say it can't be undone, and give two buttons: Cancel (the default focus) and a red "Delete project". Only delete after the second button is clicked.”

Why it works

"Add something" could mean hiding the button, adding Undo, or a warning banner; "confirmation dialog" names a blocking question and the prompt sets its wording and buttons.

In the wild

You've seen this in

  • GGoogle Drive asking before you permanently delete a file
  • GGitHub making you type a repository's name before it deletes it
  • SShopify asking you to confirm before cancelling an order
Usage note

Often confused with