All guides
OverlaysPatterns6 min read

Modal or drawer?

Both float above the page, both dim what's behind them — but they answer different questions. This guide is the decision framework; the style guide shows the components themselves.

If you only remember one rule

A modal is the app interrupting the user; a drawer is the user inspecting something. Modals demand a decision before anything else can happen, so they earn their interruption only when that decision is short. Drawers accompany the page rather than blocking it — the user opens one, works in it, and expects the page behind to still be there.

Quick reference

The three tools, side by side. When in doubt, drop down a row — a drawer beats an overloaded modal, a page beats an overloaded drawer.

 ModalDrawerFull page
Feels likeAn interruptionA side panelA destination
Content sizeOne decision, ≤3 fieldsScrollable, sectionedUnlimited
Context behindIrrelevant to the decisionStill visible & usefulReplaced
Typical jobsConfirm, quick input, alertRecord detail, edit forms, settingsPrimary tasks, wizards
In this appDialogPopupDialogSheetpage.tsx

Five questions

Walk them in order — the first question that gives a clear answer decides it.

  1. 1
    Who started this — the app or the user?

    The app needs an answer before anything continues (confirm a delete, resolve an error, warn about unsaved changes) → modal. The user chose to open something and the app is just showing it → drawer or page.

  2. 2
    How much content is there?

    A single decision, or one to three fields, readable without scrolling → modal. Anything that scrolls, has sections or tabs, or needs a header–body–footer structure → drawer.

  3. 3
    Does the page behind still matter?

    If the user needs to reference the page underneath — checking a row in the table, comparing values, working through a list record by record → drawer. A modal deliberately hides the context; only use it when the context genuinely doesn't matter for the decision.

  4. 4
    Does it need a URL, the back button, or multiple steps?

    Deep-linkable, shareable, part of a multi-step flow, or complex enough to have its own sub-navigation → it's a page, not an overlay. Overlays are for side quests, not the main quest.

  5. 5
    Will it need to open something else?

    Modals must not stack on modals. If the content contains actions that open pickers, previews, or confirmations, start from a drawer (a modal on top of a drawer is fine, and a drawer may drill into one more drawer) or a page.

Reach for a modal when…

Short, centred, blocking. The user deals with it and moves on — seconds, not minutes.

  • Destructive or irreversible confirmations — delete, remove access, cancel a shiftDelete saved view
  • One quick input before an action can proceed — name a thing, pick a dateSave view, Create form
  • Blocking errors and warnings the user must acknowledgeUnsaved changes warning
  • A short, focused choice from a small listAdd a task to a project
One decision, two buttons, no scrolling — the whole pattern in one example.

Reach for a drawer when…

The user is inspecting or editing something adjacent to the page — the page stays put, the drawer visits.

  • Record detail opened from a list — peek at a row without losing your placeParticipant drawer
  • Create / edit forms with more than a few fieldsTemplate drawer
  • Settings or configuration panels with grouped optionsForm settings
  • Supporting context alongside the main task — notes, activity, previewTask notes
Header, scrollable body, footer — and a modal confirm layered on top, the one stacking combination that's allowed.

Use neither when…

Overlays are for side quests. The moment something is the main task, give it a page.

  • Primary workflows the user came here to do — those deserve the whole screen
  • Multi-step flows and wizards (progress needs room, and the back button should work)
  • Anything that should be shareable or bookmarkable via URL
  • Long forms (roughly 8+ fields) or layouts with their own tables and navigation

A warning inside a modal

When a modal's primary turns up something to confirm, the warning joins the modal instead of stacking a second one on it. DES-54.

  • The warning appears as a band at the end of the modal's body, just above the footer, and the primary turns into Extend Anyway or Reinstate Anyway. That press is the confirmation, so there's no “Are you sure?”.
  • The band is announced when it appears. Focus stays on the primary you just pressed.
  • Changing an input clears the band, since it described the old input.
  • From a drawer or a page, the same warning is still its own modal: that's the app interrupting, and a band at the foot of a long drawer would sit out of view.
Extend Group Support

This recurring group support ends on 31 Oct 2026.

New End Date
30 Nov 2026
Before: the primary is the plain verb.
Extend Group Support

This recurring group support ends on 31 Oct 2026.

New End Date
30 Nov 2026
  • Aroha Ngata is not available during the shift on 7 Nov 2026.
  • Grace Okafor has a pending leave request during 2 shifts in this series, from 14 Nov 2026.
After the check: the warning joins the dialog above the footer, and the primary confirms.
The real Extend Support dialog on a seeded series. Pick “1 month” and the worker's annual leave turns up.

Do / Don't

Do
  • Always include a visible title and an explicit close affordance
  • Confirmations are always modals — a drawer is too easy to dismiss for a destructive decision
  • A modal over a drawer is fine (e.g. a delete confirm inside a record drawer)
  • A warning raised inside a modal joins it: a band above the footer, and the primary becomes “… Anyway”
  • On dirty forms, intercept backdrop-click and Esc with a discard confirmation
  • Return focus to the element that opened the overlay when it closes
Don't
  • Don't put a long or scrolling form in a modal — that's the drawer's job
  • Don't stack a modal on a modal, not even for a warning, and keep drawer drill-ins to two layers — a third layer means it should be a page
  • Don't use a drawer for a blocking error or confirmation — it reads as optional
  • Don't open any overlay automatically on page load
  • Don't use overlays for the primary task — a side quest UI for the main quest feels cramped

Behaviour both share

Whichever presentation wins, the mechanics are the same — both are the one Base UI dialog underneath.

  • Focus is trapped inside while open, and returns to the trigger on close.
  • Esc and backdrop-click close it — unless the form is dirty, in which case confirm the discard first.
  • Every overlay has a title, even if visually hidden, so screen readers announce it.
  • On mobile the drawer grows to near-fullscreen and the modal stays compact — another reason typed-heavy content belongs in the drawer.

Sources

The framework distils published guidance — worth reading in full when a case doesn't fit neatly.

Agents get the same rules in condensed form: apps/next/docs/ux-guides/modal-vs-drawer.md — keep both in sync when the framework changes.