What is a modal?
A modal is a window that appears on top of the current screen and blocks interaction with everything behind it until the user responds or dismisses it. The word comes from “mode”: while it’s open, the app is in a special mode where only the modal works.
You’ll usually see one used to:
- Confirm a destructive or important action: Delete 3 photos?, Cancel your subscription?, Discard changes?
- Ask for a quick decision: Allow notifications?, Choose a delivery time.
- Do a short, focused task without leaving the page: edit a delivery address, add a card, write a review.
- Tell the user something they must acknowledge: Your session expired. Please log in again.
Anatomy
- 1
Scrim (backdrop)
A dark layer over the page. It shows that the page behind is blocked until you finish.
- 2
Container
The dialog surface itself. It must fit the screen, even on a small phone with large text.
- 3
Title
A short question or statement: "Delete 3 photos?", not "Are you sure?".
- 4
Supporting text
Explains the consequence. Long content must scroll inside the container.
- 5
Dismissive action
Cancel / Keep editing. Closes the dialog without changing anything.
- 6
Confirming action
The verb from the title ("Delete"). Red when it destroys data.
- 7
Close button
Optional X (common on web). Behaves exactly like Cancel.
How it differs from similar components
The key questions are: does it block the screen? and does the user have to respond? Using a blocking component for something that didn’t need it is a valid usability finding.
| Component | Blocks the screen? | Needs a response? | Typical use |
|---|---|---|---|
| Alert dialog | Yes | Yes | Short, urgent decision: “Delete account?” |
| Dialog | Yes | Usually | A small task or choice: pick a date, rename a file |
| Full-screen dialog | Yes (covers it) | Save or close | A longer task on a phone: new event, new address |
| Modal bottom sheet / action sheetAction sheetThe iOS list of choices that slides up from the bottom, often used to confirm or pick an action.Open in glossary → | Yes | Pick an option or dismiss | A list of actions or options: Share, Sort by |
| Popover / menu | Partly (closes on outside tap) | No | Extra options next to a button |
| Toast / snackbarToastA short, temporary message that appears briefly and disappears on its own, like 'Message sent'.Open in glossary → | No | No (optional action) | Brief feedback: “Message archived · Undo” |
| Banner / inline message | No | No (optional action) | Persistent status or warning on the page |
Dev note
Apple calls the small centered one an alert and the bottom list an action sheet; larger ones are sheets. Google’s Material Design calls them dialogs (basic and full-screen) and bottom sheets. On the web you’ll hear modal, dialog, popup and lightboxLightboxA full-screen viewer that opens a photo from a thumbnail on top of the page.Open in glossary →. In bug reports, use the name your team uses, and say which kind it is.
Designs & variants
Each platform has its own look and its own rules for how a modal can be closed. The chips under each demo list the exits that should work.
Every demo works. Open each one and try every way out: the buttons, tapping outside, Esc, and (on the sheet) dragging the handle down.
Albums
Alert
iOSSmall, centered, max two side-by-side buttons. Tapping outside does nothing: the user must choose. Destructive actions are red, Cancel is bold.
Albums
Action sheet
iOSSlides up from the bottom with a list of choices and a separate Cancel. On iPad it becomes a popover next to the button.
Settings
Basic dialog
Android · Material 3Rounded 28dp surface, text buttons on the right: dismissive first, confirming last. The system Back gesture closes it.
Settings
Full-screen dialog
Android · Material 3For longer tasks on phones (forms, multiple fields). X closes, Save confirms. Closing with unsaved input should ask before throwing it away.
Your cart
Modal dialog
WebUsually a white card with an X, a backdrop and footer buttons. Built by hand far too often, so focus and Esc handling are frequent bugs.
Settings
Modal bottom sheet
Android · iOS · WebEasy to reach with one thumb. iOS has sheets too (with detents, medium and large). Test the swipe-down gesture and what happens to typed data.
Check this part
What makes a modal different from a toast?
Which one is a typical use for a modal?