Back to Explore
GuideVibeFix editorialUpdated Nov 15, 2026

A Dialog Is a Knock, Not a Megaphone: Modals and Confirmations for Your Vibe Project

A dialog is a knock on the door, not a megaphone. This guide covers when to show one at all, writing titles that state the matter and buttons that state the action, three ways to confirm dangerous actions, keyboard and focus traps, and bottom action sheets on mobile. All example projects, people, and numbers in this guide are fictional.

A real photograph: a hand holds a smartphone while a finger is about to tap the blue Confirm button on a centred dialog, with Cancel below it.

Xiao Man is cooking braised pork in her kitchen, following "RecipeBox," her phone propped by the stove, her hands covered in oil. She wants to save the recipe, so she taps save, and a dialog pops up: "Are you sure you want to save this?" Two buttons below: "Confirm" and "Cancel." She pauses: saving needs a confirmation? She tries to tap "Confirm," but her oily finger slips and hits "Cancel." The dialog is gone, and so is the save. She wipes her hands, taps save again, and the dialog comes back. She taps "Confirm" this time and it works, but the mood is gone — it is one recipe, why ask twice? That evening she deletes RecipeBox and switches to an app where saving needs no confirmation. Not because she hates dialogs — because at the moment her hands were busiest, the app asked her a question that never needed asking.

Two things first. First, everything in this guide's walkthrough — the project "RecipeBox," the operator "A-Nan," the user "Xiao Man," and all times and quantities — is fictional, invented only to make the flow clear. Second, the boundaries: this site has already published several neighbouring guides — the toast notification guide is about light, non-interrupting reminders, a "no need to stop what you are doing" question; the form validation guide is about inline errors inside forms, a "say it right where it went wrong" question; the error and empty states guide is about what the screen says when something goes wrong, a "what to say in the moment" question; the notification preferences guide is about whether users want to receive notifications; the runtime permission prompts guide is about asking the system for permissions (camera, location, notifications), a "asking the system" question. This guide repeats none of those. It covers one thing only — how to ask when the app itself stops the user to ask a question. A toast is about "no need to stop"; a dialog is about "you must stop and think." Different jobs.

A real photograph: a hand holds a smartphone while a finger is about to tap the blue Confirm button on a centred dialog, with Cancel below it.

1. First, the reality: a dialog is an interruption, and users hate being interrupted

Many teams get nervous when they hear "dialog" and assume that if they just make the dialog look nice, users will not mind. That is only half right: however nice a dialog looks, it does not change what it does — it interrupts the user. The user is in the middle of something, the screen is suddenly covered, and they must answer a question before they can continue. What users actually hate is not "a dialog appeared" but "being stopped at the wrong moment to answer a question that never needed asking." Saving a recipe is reversible — save the wrong thing and you can unsave it — so there was nothing to ask. Xiao Man was stopped twice, and the first time she even tapped the wrong button. That is why she uninstalled.

The fictional example numbers in this guide are: out of 100 important dialogs, 87 users read the question through, 72 could tell the two buttons apart at a glance, 59 tapped the one they actually wanted, and 46 said afterwards that "the reminder was the right call." These numbers are fictional, and they exist to make one point: a dialog is also a funnel, and every step leaks people. Only 87 out of 100 read the question, which means a dialog first has to solve "will the user even read it"; 72 could tell the buttons apart at a glance, which means it also has to solve "can the user tell which one to tap"; and only 46 said afterwards that the reminder was right, which means it also has to solve "does the user agree with the reminder after the fact." Any step done carelessly leaks users at exactly that step.

There is a second pair of fictional numbers for comparison: when buttons only said "Confirm" and "Cancel," 23 out of 100 people tapped the wrong one; when the buttons were rewritten as action verbs — "Delete this note" and "Keep it" — only 6 out of 100 tapped the wrong one. The numbers themselves are fictional; the point is not 23 versus 6 but that what the button says decides whether users tap the wrong one — the word "Confirm" does not tell the user "confirm what," so they have to read the title, understand the question, and map "Confirm" onto the title's meaning, and if their attention slips at any of those three steps, they tap the wrong one. The first rule of dialogs is this simple: a dialog is a knock on the door, not a megaphone — knock gently, say why you are here, and let the person know at once whether to open it.

2. When to show one, and when not to

Before writing a dialog, sort out which of two kinds it is: one that "must ask" and one that "need not ask." "Must ask" has three conditions, and if any one is missing, do not show it. The first condition is "irreversible": what gets deleted cannot be recovered, what gets sent cannot be unsent, what gets paid cannot be unspent — only that kind of action is worth stopping the user for. The second condition is "serious consequences": once done, the user is clearly harmed — an article two hours in the writing is gone, a whole photo album is emptied, an order already in progress is cancelled. The third condition is "the user may not know": the user thinks they are doing A but is actually about to do B — for example, they think they are deleting one note but are about to delete the whole notebook. Only when all three conditions hold is a dialog worth showing.

The "need not ask" list is longer, and worth pinning to the wall. First, reversible actions need no asking: saving, liking, following, adding to cart — a mistake can be undone, so do not stop the user. Second, routine actions need no asking: saving, sending, submitting — the user tapped the button, the meaning is already clear, and asking again means not trusting them. Third, information does not need a dialog: a toast is enough — "Saved," "Sent," "Saved to favourites" — say it and move on, without stopping the user to tap "Got it." Fourth, marketing must not use dialogs: new feature announcements, promotions, rating requests — the user is busy doing real work, and a promotional dialog is a flyer handed out in the kitchen. Fifth, a question already answered must not be asked again: if the user already picked "do not remind me again," do not pop it up again next time — asking the same question twice is harassment.

The test is simple: before showing a dialog, ask yourself three questions — is this action irreversible? Are the consequences serious? May the user not know? Only if all three are "yes" should it appear; if any one is "no," use a toast, an inline hint, or nothing at all. The total number of dialogs needs a cap too: the fictional example number in this guide is at most 2 dialogs in one flow. The number is fictional; the point is "there must be a clear cap" — three or four dialogs in one flow, and what the user remembers is not "this app is careful" but "this app asks me something at every step."

3. Clear at a glance: the title states the matter, the buttons state the action

Once you have decided to show one, the next question is "how to write it." There is only one rule for writing a dialog: the user should know "what is happening and which one to tap" from a single glance. That takes three pieces; miss one, and the user has to stop and think.

First, the title states the matter: the title should say "what is about to happen," not empty words like "Notice," "Warning," or "Alert." "Delete this note?" is a title; "Notice" is not a title. Reading the title alone should tell the user what is happening, without reading the body. Second, the body states the consequence: one sentence only — "Deleted notes can be recovered from the trash within 30 days, and are permanently deleted after 30 days." Do not write three paragraphs of reasoning, and do not write correct-but-useless lines like "Deletion cannot be undone, please proceed with caution." The only thing the user needs to know is: what happens if I tap. Third, the buttons state the action: write verbs on the buttons, not "Confirm" and "Cancel." "Delete this note" and "Keep it" tell the user which is which without reading the title; "Confirm" and "Cancel" force the user to read the title, understand it, and map the words onto it — three steps, all required. The rule for buttons is: reading the button alone should tell you what tapping it will do.

There are two more details for buttons. The first is order: the dangerous action (delete, pay, exit without saving) goes on the right or below, and the main action (keep, go back, keep writing) goes on the left or above — the first button the user's hand naturally reaches should be the safe one. Some apps put "Delete" in the most prominent spot and hide "Cancel" in a corner; one slip of the hand deletes something, and that is design doing harm. The second is colour: the dangerous button can be red, but do not make both buttons red, and do not make "Cancel" small grey text while "Delete" is a big red button — colour is for telling things apart, not for selling the dangerous action. Users telling them apart and tapping correctly matters more than anything.

4. Dangerous actions: three ways to write a confirmation

Delete, pay, and exit without saving — the three most common dangerous actions — each need their own confirmation wording. One template cannot cover all three.

For deleting, the core question is "can it be recovered." The fictional example number in this guide is that deleted content can be recovered from the trash within 30 days. The number is fictional; the point is "there must be a clear recovery window, written in the confirmation itself." When users see "can be recovered from the trash within 30 days," they know: if I tap wrong, I can still get it back. The title is "Delete this note?", the body is "Deleted notes can be recovered from the trash within 30 days, and are permanently deleted after 30 days," and the buttons are "Delete this note" and "Keep it." Three lines, and the user understands all of it. If the action deletes a whole notebook or a whole album — "delete a lot at once" — the body must state the scope: "This will delete 12 notes in this notebook." Do not let the user think they are deleting one thing.

For paying, the core question is "is the amount right." The title is "Pay 128 yuan to confirm?", the body is "One year of membership, 128 yuan, charged to your linked bank card, refundable within 7 days." The user only needs to check three things: how much, what for, and whether it can be refunded. Do not put coupons, promotions, or "one extra month free" in a payment confirmation — the user is checking the amount, and any extra information is noise. The payment button should read "Pay 128 yuan to confirm," not just "Confirm" — the moment the user's finger lands, it is pressing on an amount of money, not on two characters.

For exiting without saving, the core question is "is my stuff still there." The user wrote half a note and tapped back; the confirmation has to say three things: "Your half-written note has not been saved yet," "If you exit now, it will stay in drafts," and "You can keep writing next time you open it." The buttons are "Save and exit" and "Exit directly," not "Confirm" and "Cancel" — what the user is choosing is not "am I sure" but "do I save or not." The best approach is not to show this dialog at all: the moment the user taps back, autosave, and ask nothing — with autosave done well, the exit confirmation does not need to exist.

5. Keyboard and focus: do not trap users inside a dialog

Once the dialog is written, there is one more gate: keyboard and focus. Four things a user should be able to do inside a dialog; miss one, and the dialog is a trap.

First, ESC must close it: on desktop, pressing ESC should close the dialog — and closing means "cancel," not "confirm." Never let ESC trigger the dangerous action, and never let ESC do nothing. Second, tapping the scrim must close it: tapping the grey area outside the dialog should close it — again meaning "cancel." Do not make the scrim a dead zone that does nothing when tapped; a user tapping the scrim wants out. Third, focus must stay trapped inside the dialog: when the user presses Tab, focus should move back and forth between the dialog's two buttons, not wander off to the page behind it — if focus escapes, the user pressing Enter may trigger a button on the page behind. Fourth, when the dialog opens, focus must land on the safe button: focus should start on "Keep it" or "Cancel," never on "Delete" — if the user accidentally presses Enter, the thing being deleted is their work.

On mobile there is one more: the back button must close the dialog. On Android, pressing the system back button should close the dialog and return to the page the user was on — not exit the app, and not trigger deletion. Pressing back means "I want to go back," not "I want to delete something." Put the keyboard and focus rules together and they say one thing: a dialog invites the user in to make a decision, it does not lock them inside — the door must open at any time, and the way out must always be visible.

6. Chained dialogs and dialog fatigue: one question at a time

One dialog is fine; two in a row, and users start getting annoyed. Dialog fatigue comes in three shapes, each worth recognizing. The first is "chain questioning": the user taps delete, a confirmation appears; they confirm, and another asks "are you really sure you want to delete it"; they confirm again, and a third says "Deleted. Empty the trash now?" One delete action asked three times — by the third dialog the user is thinking "are you ever going to stop." The fix is: ask one thing once, and stop asking — one confirmation for a delete is enough, and after deleting, a toast saying "Deleted, recoverable from the trash within 30 days" is all that is needed, not another dialog. The second shape is "asking everywhere": the user opens the app and gets a new-feature announcement; opens a page and gets a rating request; tries to leave and gets a retention dialog. Asked three times in one minute, by the third time they tap dismiss without reading — and a genuinely important confirmation gets dismissed along with the rest. The fix is: marketing and feature dialogs appear at most once a day, and never in the same flow as a confirmation. The third shape is "asking for nothing": the user already picked "do not remind me again," and the next time the app opens, the dialog is back — what the user said last time, the product forgot right away. The fix is: record the user's choice; "do not remind me again" means really never again, not the same question in different words.

The test for dialog fatigue is simple: once users start tapping dismiss without reading, the dialog has already failed. A confirmation that users dismiss without reading is no confirmation at all — when they tap "Delete," they never saw what they were deleting. Control the number of dialogs, and control the quality even more: better to show one fewer dialog than one too many; better to let the user take one extra step than to train them to dismiss every dialog on sight.

7. On mobile: bottom action sheet or centred dialog

Dialogs on a phone are not the same as dialogs on a desktop. Phone screens are small, fingers are big, and users often operate one-handed; a centred dialog on a phone is one of the worst options: it covers the middle of the screen, the user has to stretch their thumb to reach the buttons, and the chance of a mis-tap is much higher than on desktop. A better approach on phones is the bottom action sheet: it slides up from the bottom of the screen, buttons stacked vertically, each one large, reachable without stretching the thumb. Delete, share, and report — "pick one action" scenarios — fit an action sheet; "confirm or cancel" with only two options also fits one — two large buttons stacked vertically are far easier to tap than two small buttons side by side in a centred dialog.

Action sheets have rules too. First, no more than 5 options: beyond 5, the user has to scroll to see them all, and the sheet loses its "see everything at a glance" value. Second, the dangerous action goes on its own: delete and report should be separated from ordinary actions by a line, or placed at the very bottom in red — never mixed in with "Share" and "Save," or a swipe of the hand may land on delete. Third, there must be a way to close it: a "Cancel" button at the bottom of the sheet, or tapping the scrim to close — if users slide it up by mistake, they need to get back at once. Fourth, never show an action sheet while the keyboard is up: the user is typing, the sheet slides up from the bottom, pushes the keyboard away, and covers the input box — the user is interrupted mid-sentence, and what they were typing may be lost.

One more detail: on phones, buttons must be big enough. The fictional example number in this guide is a minimum button height of 44 points. The number is fictional; the point is "there must be a clear minimum size" — buttons too small cannot be tapped reliably by oily hands, gloved hands, or hands shaking while walking. Make the buttons a little bigger, users tap a little more accurately, and mis-tap complaints drop.

8. Pre-launch checklist

Go through this checklist item by item before shipping any feature with a dialog. First, should it appear at all: only show it when all three conditions hold — the action is irreversible, the consequences are serious, and the user may not know; reversible actions, routine actions, information notices, marketing content, and already-answered questions never get a dialog; at most 2 dialogs in one flow (a fictional example number). Second, clear at a glance: the title states "what is about to happen," never "Notice"; the body is one sentence saying what happens if the user taps; the buttons are action verbs — "Delete this note" and "Keep it," never "Confirm" and "Cancel"; the dangerous action goes on the right or below, the main action on the left or above; reading the button alone tells you what tapping it will do. Third, three ways to write confirmations for dangerous actions: deleting states that content can be recovered from the trash within 30 days (a fictional example number) and how much is being deleted; paying states how much, what for, and whether it can be refunded, with the amount on the button; exiting without saving states whether the content is still there, where it is saved, and whether the user can continue next time — and the best approach is autosave, with no dialog at all. Fourth, keyboard and focus: ESC closes it, tapping the scrim closes it, Tab focus stays trapped inside the dialog, focus lands on the safe button when it opens, and the Android back button closes it; a dialog invites the user in to make a decision, it does not lock them inside. Fifth, chained dialogs: ask one thing once, and after deleting, a toast is enough — do not ask again; marketing dialogs appear at most once a day and never in the same flow as a confirmation; when the user picks "do not remind me again," it really means never again. Sixth, on mobile: use a bottom action sheet instead of a centred dialog wherever possible; no more than 5 options; the dangerous action goes on its own, marked red; buttons at least 44 points tall (a fictional example number), so even oily hands can tap them accurately.

And six pitfalls to repeat once more. First, do not show a confirmation for a reversible action: saving, liking, and following can be undone, so do not stop the user. Second, do not write "Confirm" and "Cancel" on buttons: users have to read the title, understand it, and map the words onto it, and if their attention slips at any of those three steps, they tap the wrong one. Third, do not put the dangerous button in the most prominent spot: one slip of the hand deletes the user's work. Fourth, do not let ESC and the back button trigger dangerous actions: pressing ESC and pressing back both mean "I want out," not "I want to delete something." Fifth, do not ask in chains: asking three times for one delete means that by the third time, users tap dismiss without reading. Sixth, do not ask again in different words after the user picked "do not remind me again": what the user said last time, the product forgot right away, which is the same as never having asked.

Modal funnel (fictional sample): 100 key modals appeared, 87 users read the question, 72 told the two buttons apart at a glance, 59 tapped what they really meant, 46 felt afterwards the reminder was right

Back to Xiao Man at the start. She still uses RecipeBox — not because it never showed a dialog again, but because last month it showed one more: she wanted to delete a recipe she had written badly, tapped delete, and the screen said, "Delete this note? Deleted notes can be recovered from the trash within 30 days, and are permanently deleted after 30 days," with two buttons below: "Delete this note" and "Keep it." She glanced at it, tapped "Delete this note," and when it was done, a light line at the top of the screen said, "Deleted, recoverable from the trash within 30 days." The whole thing asked her to make one decision. She was not asked a second time, she did not tap the wrong button, and she did not have to stop and think. That is what a dialog is for: sooner or later, users will do something irreversible in your app, and before they do, the product's job is not to block them, not to scare them, and not to make them read three paragraphs — it is to say clearly "what will happen" and "which one to tap," so they understand at a glance, tap right the first time, and get back to what they were doing as if nothing had happened.

Views 7Comments 0

Comments (0)

ME
0/1000
Loading comments...
Browse projectsPublish your project

Related articles

Real photo: a laptop, tablet, and phone on a wooden table showing the same green-leaf website, the phone view with navigation in one column, a potted plant nearby
Guide
Squashed on phones? Responsive layout and media queries, explained plainly

One page should stand up on a phone, a tablet, and a computer. This guide follows MDN's Responsive web design, Using media queries, and the viewport meta reference: fluid HTML, the viewport tag, fluid grids and max-width, images that never burst their container, media query syntax, breakpoints set by content, mobile first, responsive type, testing capability instead of width, and a pre-launch checklist.

Mobile AppsDesign ExperienceFrontend Engineering
Real photo: a bank of light gray metal filing cabinets with one drawer pulled open, revealing rows of hanging file folders inside
Guide
A real database inside the browser: IndexedDB local storage, explained plainly

localStorage only stores strings and has no indexes. IndexedDB is a real database in the browser: structured data, far larger capacity, indexes, and transactions. Following MDN's Using IndexedDB, IDBDatabase, and IDBObjectStore: the five-step routine, opening, upgrades, keys, indexes, transactions, add versus put, get, cursors, ranges, and multi-tab upgrades.

Tool TipsData WorkflowsFrontend Engineering
Real photo: hands typing on a MacBook Pro showing JavaScript code that changes HTML content, with a white mouse, papers, and binders on a white desk
Guide
Functions without the confusion: JavaScript functions, parameters, and arrow functions, explained plainly

You already call functions every day; this guide names what you have been doing. Following MDN's Functions, Arrow function expressions, and Rest parameters: declarations versus expressions, parameters and arguments, default values, rest parameters, spread syntax, return values, arrow function shorthand, the this trap, callbacks, and scope.

Tool TipsFrontend EngineeringAI Coding