Design8 min

Modal vs drawer: when to use each UI pattern (with examples)

Modal vs drawer, explained simply: when each UI pattern fits, how bottom sheets and side panels differ, the accessibility rules, and a quick decision table.

Saurabh YadavFounder, Design Studio by Saurabh
DesignModal vs drawerWhen to use a modalSide drawer UIDrawer vs dialog
Share

You tap "Edit address" on a delivery app and a box slams into the middle of the screen, dims everything behind it and hides the order you were checking. You only wanted to change the flat number. Somewhere, a team picked a modal when a drawer would have done the job, and you felt it in your thumb.

Both patterns put content on top of the page. What differs is how much they ask of the user.

The short answer: Use a modal when you need the user to stop and make one focused decision before they carry on, like confirming a delete or accepting terms. Use a drawer (a side panel or bottom sheet) when the user needs extra detail or options while keeping the main page in view, like filters, settings or item details. If the task doesn't need to block everything, it probably isn't a modal.

What's the actual difference between a modal and a drawer?

A modal is a dialog that blocks the rest of the interface until the user responds. The page behind is dimmed and can't be used. It's an interruption by design.

A drawer slides in from an edge of the screen. On desktop it usually comes from the right or left as a side panel. On mobile it often comes up from the bottom as a sheet. Drawers can be modal too (with a dimmed backdrop that blocks the page) or non-modal (the page behind stays usable). That second kind is what makes drawers so flexible.

Both Material Design and Apple's Human Interface Guidelines treat these as related but different tools. Apple's sheets on iPhone can stop at a medium or large height, so the user still sees part of the screen underneath.

So the real question in the modal vs drawer debate isn't about shape. It's this: does the user need to keep their context while they do this task?

Situation Better choice Why
Confirm a destructive action (delete, cancel order) Modal One decision, needs full attention
Filters on a product list Drawer (side panel or bottom sheet) User wants to see results change behind it
Viewing a row's details in a dashboard table Side drawer Keeps the table visible for quick comparison
Short form with 1 to 3 fields Modal or bottom sheet Small, focused task
Long form or multi-step flow Full page Too much for any overlay
Share options, quick actions Bottom sheet Reachable with a thumb, easy to dismiss
Critical error that blocks progress Modal The user can't continue anyway

When a modal is the right choice

Modals earn their interruption when the task is short, focused and important enough to stop everything else. Good uses:

  • Confirming destructive actions. "Delete this project? This can't be undone." A modal makes sure the user actually reads it.
  • Required decisions. Choosing between two clear options before moving on.
  • Short, self-contained tasks. Renaming a file, adding a tag, entering a coupon code.

Keep a modal small: one title, a sentence or two, and specific button labels ("Delete project", not "Yes"). If it needs tabs, scrolling or a second step, move it to a full page.

Watch out

Don't open a modal the moment a page loads. Newsletter pop-ups, "rate us" prompts and surprise offers interrupt people before they've done anything, and most users close them without reading. Interruptions should follow something the user did, not greet them at the door.

When a drawer works better

Drawers shine when the content supports the main page rather than replacing it.

Side drawers on desktop

A side panel is ideal for details and editing in data-heavy products. Click a row in a table, the panel slides in from the right with the full record, and the table stays visible on the left. The user can click the next row without closing anything. This is one of my favourite patterns for SaaS dashboards, because comparison is half the job there.

Bottom sheets on mobile

On phones, bottom sheets are often a better fit than centred modals. They sit in the thumb's comfortable zone, they can be swiped down to dismiss, and a half-height sheet keeps the map, list or product visible above it. Ride-hailing and food delivery apps use them everywhere for this reason.

From my work

On Pukaar.ai, the persona was a parent at 2 a.m., probably holding the baby in one arm. One of our design decisions was "no blocking modals". When someone is stressed and using one hand, a box that freezes the screen and demands a precise tap on a small "X" is the last thing they need.

The classic hamburger menu is also a drawer. It works, but it hides your navigation. I compare it with bottom tabs in hamburger menu vs tab bar.

Accessibility rules for modals and drawers

Overlays are easy to build and easy to break for keyboard and screen reader users. The basics:

For modals (and modal drawers):

  • Use role="dialog" with aria-modal="true", and give it an accessible name with aria-labelledby pointing at the title. The native HTML <dialog> element opened with showModal() handles much of this for you.
  • When it opens, move keyboard focus into the dialog, usually to the first interactive element or the title.
  • Trap focus inside while it's open, so pressing Tab doesn't wander into the dimmed page behind.
  • Close it with the Esc key, and with a visible close button.
  • When it closes, return focus to the element that opened it. Without this, keyboard users get dumped at the top of the page.

For non-modal drawers:

  • Don't trap focus, since the page behind is still usable.
  • Make sure the drawer is reachable by keyboard and has a clear heading.
  • Give it a close button and let the trigger toggle it.

On mobile: the Android back gesture should close an open sheet or dialog, not leave the screen entirely. Bottom sheets should have a visible close option too, not only a swipe, because not everyone can or will swipe.

Tip

Test every overlay with only a keyboard: open it, Tab through it, press Esc, and check where focus lands. It takes two minutes and catches most problems. My post on why accessibility is UX covers more checks like this.

Common mistakes I see

  • Long forms in overlays. Users lose their work when they accidentally tap the backdrop. If a form is more than a few fields, give it a page. My guide to form design best practices goes deeper.
  • Closing on backdrop tap with unsaved changes. Either warn the user or don't close on backdrop tap for editing tasks.
  • Heavy animations on low-end phones. A sheet that stutters as it slides up on a budget Android phone feels broken. Keep transitions short and simple.

A quick checklist before you ship an overlay

  • Does this task really need to block the page? If not, use a drawer or inline content
  • Is the content short enough that it won't need to scroll much?
  • Does focus move in on open, stay trapped (for modals) and return on close?
  • Does Esc close it, and does the Android back gesture close it on mobile?
  • Are the button labels specific about what happens?
  • What happens to unsaved input if the user taps outside?
  • Does it animate smoothly on a low-end Android phone?

Work with us

Working on a SaaS product? Our SaaS design agency designs web apps, dashboards and complex data screens.

FAQ

Is a bottom sheet a modal or a drawer?

It can be either. A modal bottom sheet dims the page and blocks it until dismissed, while a standard (non-modal) sheet lets the user keep using the screen behind it. Pick based on whether the user needs to keep interacting with the main content.

When should I avoid using a modal?

Avoid modals for long forms, content people need to compare with the page behind, anything shown on page load, and multi-step flows. If the user didn't ask for the interruption, or the task takes more than a short moment, a drawer or a full page is usually better.

Do drawers need focus trapping like modals?

Only modal drawers, the kind with a dimmed backdrop that blocks the page. Those should trap focus, close with Esc and return focus to the trigger. Non-modal drawers should not trap focus, because the rest of the page is still meant to be usable.

Key takeaways

  • The modal vs drawer choice comes down to one question: does the user need to keep their context?
  • Use modals for short, focused decisions like confirmations, and keep them small.
  • Use side drawers for details and editing on desktop, and bottom sheets for quick options on mobile.
  • Modals need focus moved in, trapped, Esc to close and focus returned to the trigger.
  • Anything long or multi-step deserves a full page, not an overlay.

What to do next

Open your product and list every overlay in it. For each one, ask whether it really needs to block the page, then run the keyboard test above. You'll probably find one or two modals that should be drawers. If you'd like a second pair of eyes on your interface patterns, tell me about your project and I'll suggest where to start.

Saurabh Yadav's Memoji

Written by

Saurabh Yadav

Founder of Design Studio by Saurabh, a UI/UX design studio in India. We design apps and websites that feel effortless, from research to shipped pixels. Most recently: Pukaar.ai, as seen on Shark Tank India, and the Demerara Bank app.

Keep reading

All articles →