Journal

How to design modals and dialogs that don't annoy people

When a modal is the right tool, how to write its title and buttons, and the focus, exit and frequency details that keep dialogs from being dismissed unread.

How to design modals and dialogs that don't annoy people

Few interface elements get closed faster than a modal. People see a box drop over the page, look for the X, and click it before reading a word. That reflex was learned the hard way: newsletter pop-ups, cookie walls, "Are you sure?" prompts for actions that didn't need one. When your product finally shows a dialog that matters, it inherits all of that suspicion.

The fix isn't to ban modals. A good dialog stops someone at exactly the right moment, asks one clear question, and gets out of the way. This guide covers when a modal is the right tool, how to structure one so people actually read it, and the details that separate a helpful interruption from an annoying one.

Decide whether it needs to be a modal at all

A modal blocks everything behind it. That's its whole purpose, so use it only when blocking is the point. Before you reach for one, ask whether the person must make a decision before they can safely continue. If the answer is no, a lighter pattern will usually work better.

  • Confirming a destructive or irreversible action (deleting a project, cancelling a subscription): a modal is appropriate.
  • Telling someone an action succeeded: use a toast or inline message instead.
  • Collecting a short piece of input tied to the current task (renaming a file, adding a link): a modal or a popover both work.
  • Showing long content or a multi-step form: use a full page or a side panel, where people can scroll and come back.
  • Promoting a feature or asking for an email: put it inline in the page, where it doesn't fight the task people came to do.

A useful test: if someone could close the dialog without reading it and nothing bad would happen, it probably shouldn't be a modal.

Trigger it from the user's action, not the clock

The most resented modals are the ones nobody asked for. A dialog that appears three seconds after page load, or the moment the cursor drifts toward the browser tab, interrupts someone who was in the middle of reading. They'll close it, and they'll remember the annoyance.

Dialogs that appear in response to a click feel different. The person just did something, so they're expecting a response, and the modal reads as part of the conversation. Wherever you can, tie the modal to an explicit action: a button press, a menu choice, a keyboard shortcut. If something truly has to appear unprompted, such as a session timeout warning, make sure it's rare and the reason is obvious from the first line.

Write a title that is the question

Most people read the title and the buttons and skip the rest. Design for that. The title should state the decision in plain words, and the buttons should answer it.

  • Weak: "Warning" with buttons "OK" and "Cancel".
  • Better: "Delete 'Spring campaign'?" with buttons "Delete project" and "Keep project".

Use the body text only for what the title can't carry: the consequence and anything that can't be undone. "This removes 14 pages and their analytics. You can't undo this." Two short sentences are almost always enough. If you need a paragraph, the decision is probably too complicated for a dialog.

Make the buttons impossible to misread

Button labels should be verbs that describe the result, not generic words like "OK", "Yes" or "Submit". Someone scanning quickly should be able to click the right one without reading the body text.

  1. Label with the action. "Delete project", "Discard changes", "Send invoice".
  2. Give the safe option a clear exit. "Cancel" is fine when it's obvious what's being cancelled; "Keep editing" is clearer when it isn't.
  3. Style destructive actions as destructive. A red or clearly marked primary button signals weight. Don't make "Delete" look identical to "Save".
  4. Keep button order consistent across your product. Whether the primary action sits on the left or right matters less than putting it in the same place every time.
  5. Don't make the dangerous option the default focus. If someone hits Enter by reflex, they should land on the safe choice for irreversible actions.

For truly high-stakes actions, like deleting a workspace with other members, asking people to type the item's name is a reasonable extra step. Use it sparingly, or it becomes another thing people learn to rush through.

Respect the ways people try to leave

People expect three exits from a dialog: a close button, the Escape key, and clicking the backdrop. Support all three for anything that isn't a critical decision. Removing exits doesn't make people read more carefully; it makes them feel trapped.

The exception is a dialog containing unsaved input. If someone has typed two paragraphs into a modal form, a stray backdrop click shouldn't throw that away. Either disable backdrop dismissal for that dialog or ask before discarding. And never hide the close button to push people toward the primary action. It's a dark pattern, and users notice.

Get focus and accessibility right

A modal that looks fine but behaves badly for keyboard and screen reader users is broken. The basics are well understood and worth building into your component once:

  • Move focus into the dialog when it opens, usually to the first interactive element or the title.
  • Trap focus inside while it's open, so Tab doesn't wander into the page behind.
  • Return focus to the element that opened it when it closes.
  • Use a proper dialog role with the title as its accessible name, so screen readers announce what the dialog is about.
  • Prevent the page behind from scrolling while the dialog is open.

The native HTML dialog element with its modal mode handles much of this for you, including the backdrop and Escape key. In Framer and most component libraries, check that the overlay you use returns focus correctly; that's the step most often missed.

Size and place it for the content

A confirmation needs a small dialog, roughly 400 to 500 pixels wide on desktop, centred, with enough padding that the buttons don't crowd the text. Bigger isn't more important; a huge box for a two-line question looks like a mistake.

On mobile, centred modals often feel cramped. A bottom sheet that slides up from the edge is easier to reach with a thumb and keeps the context visible above it. Whatever you choose, keep the action buttons visible without scrolling. If people have to scroll inside a dialog to find "Confirm", the content belongs on a page.

One dialog at a time. If a modal opens another modal, step back and redesign the flow.

Check how often people see it

Every confirmation dialog has a cost, and that cost grows with repetition. If someone archives twenty emails in a row and confirms each one, they'll stop reading by the third. At that point the dialog protects nothing.

Two alternatives often work better than confirming. The first is undo: perform the action immediately and show a toast with an "Undo" button for a few seconds. It's faster and still recoverable. The second is a soft delete, where removed items sit in a trash folder for 30 days. Save the confirmation modal for actions where undo genuinely isn't possible.

If you have analytics, look at how quickly people dismiss each dialog. A median of under a second means nobody is reading it, and it's time to rethink whether it should exist.

Conclusion

A good modal earns its interruption. Open it because someone did something, ask one clear question in the title, label the buttons with what they do, let people leave the way they expect, and make sure keyboard and screen reader users get the same experience. When you're unsure, try undo, an inline message or a side panel first. The fewer dialogs your product shows, the more attention each one gets.

Oybek Ruziev

Designer & Framer developer · AidanCreates

Keep reading

All posts