Blocking, sliding, and the return. The two large surfaces that take over part of the screen: one stops everything until a decision is made, the other works beside the page it came from. When each is right, how they are built and placed, how focus gets in and back out, and what happens when one opens inside another.
A dialog and a drawer hold the same kinds of task, forms and edits included, and the choice between them is three questions asked in order. Does the user consult the page while working? If they compare against neighbouring rows, copy a value from the page, or check a clash, slide: the drawer leaves the identifying columns in view. If the fields stand on their own, block: the dialog puts the task in the centre, where the eye already is. What shape is the content? Wide and short is a dialog, narrow and tall is a drawer (section II). One task or a run of them? Record after record is a drawer; one question, answered and gone, is a dialog. "Is it an edit?" is not one of the questions.
Both surfaces sit at level 3 and both are opened from the page, so products pick between them by habit. They are not interchangeable. A dialog covers the middle of the page, which is where the context usually is: the row being edited and its neighbours. A drawer covers the edge, leaving the start of every row, where a collection keeps its identifying columns, in view. The specimens below are in the ferry operator's timetable office from Popover I: an edit that is checked against the rows, a confirmation, and an edit that isn't checked against anything.
The retime fails as a dialog because this edit is checked against the rows. The 07:40 moves to 07:55 only if nothing else leaves Ostrand at 07:55, and the answer is on the table. A 560px dialog centred on it covers all eight rows; the drawer covers the vessel column at the right and leaves departure and route, the columns that identify a sailing, readable beside it. The vessel edit is the opposite case, and the more common one. A name, a passenger capacity, a crew complement and a home port stand on their own: nothing on the timetable bears on them, so the page is irrelevant until Save, and a dialog is the better surface. It opens in the centre where the user is already looking, its 560 holds the two short fields side by side, and the scrim says plainly that the page will wait. The drawer works, but it sends the eye to the right edge to preserve rows nobody will read. Most renames, detail edits and creates are this kind, which is why this chapter's own form, Add a sailing, is a dialog.
The confirmation fails as a drawer for a third reason. A question that has to be answered before anything else happens should not leave the rest of the page operable: with no scrim, a click on the table changes the very selection the drawer is asking about, and the verb sits at the bottom of a full-height panel, a long way from the question. Nielsen Norman Group puts the line where this chapter does: use a modal to interrupt when "an action may have destructive, irreversible consequences," and avoid one "for complex decision making that requires additional sources of information unavailable in the modal." The third question breaks ties. A dispatcher working down the timetable, fixing sailing after sailing, wants a drawer that stays open and changes record. A dialog is opened, answered and closed, once.
When the run is reading, not changing, the answer is a third surface. A dispatcher checking each sailing's master and bookings in turn needs neither: the inspector is a pane docked beside the list that shows the rest of the selected record, read-only, and a click on another row swaps it at no cost, because it never holds work. Editing starts from it, never in it. The three, cleanly: a dialog blocks in the middle; a drawer overlaps at the edge, with the scrim when it holds work; an inspector docks beside, at the same level, and holds nothing (section V).
| Modal dialog | Drawer | Inspector | |
|---|---|---|---|
| For | A task whose fields stand on their own: a create, a self-contained edit, a confirmation, an irreversible choice; content wide and short, up to 720 | A task checked against the page; a long one-column form; a run of records | Reading one record beside the list |
| Blocks | Always | Always when it holds work, and an edit always does; only live filters and narrow navigation leave the page live | Never |
| Size | sm 400 · md 560 · lg 720, by content | 400 · narrow 320 · wide 560; full height | 400 · 320 |
| Scrim | rgb(46 40 30 / .40) · dark black .60 | Same when it holds work; none for live filters | None |
| Dismissal | Escape, ×, Cancel; the scrim only when nothing has been typed | Escape, ×, the scrim; asks first only when edited | Close, or stays open |
| Focus | In on open, trapped, back to the opener | In on open; trapped when modal; back to the opener | Not moved on open |
| Layer | level 3 · modal 1200 · top layer | level 3 · drawer 1100 · live filters level 2, rail 200 | level 0 · in flow · hairline |
| Motion | in base 200 · out fast 150 · scale .96 → 1 | in slow 300 · out base 200 · its full width | none, or the drawer's when it overlays below 1200 |
Everything after the choice is shared: Save on the button, ask once edited, focus in and back to the opener, the same scrim (sections VII to IX). The boundaries, stated once. Elevation I gave both surfaces their level, their layer, and the scrim's alpha, and Elevation II their material, which is opaque. Border I gave the dialog lg 12 and the drawer none on its docked edges. Motion I §IX gave their entrances and exits. Popover I owns everything anchored and non-blocking, and handed this chapter the commit that doesn't belong in a popover. Feedback & Notification (planned) owns the toast and the banner; Loading & Skeleton States (planned) owns the veil that blocks while something loads; Forms (planned) owns multi-step flows. What is left is here.
The shape of the content is the hard constraint, and the one that most often decides. A dialog is wide and short: 400, 560 or 720 across, its top at 12vh, its height capped at 76vh, 646px on an 850 window, before its body scrolls. A drawer is narrow and tall: 320, 400 or 560 across and the whole height, about 738px of body between a 56 header and a 56 footer. Wide content goes in a dialog, long content in a drawer, and content wider than 720 on a page.
Wide content: a dialog. Fields side by side, a table inside the form, a preview beside the fields: these need width and not much height, which is the dialog's shape. The route's fares are five tickets by four prices. In an lg 720 dialog every ticket name sits on one line and every price box is wider than its price; in a 560 drawer the same grid is squeezed into 512px of body, and two of the five ticket names and one column header wrap, while the price boxes shrink from 111px to 83. Nothing on the timetable bears on a fare, so the drawer's one advantage, the page beside it, buys nothing here. And a drawer past 560 eats the page it was chosen to preserve: at 720 it would cover 53% of a 1360 window, which is the strange feeling of an over-wide drawer, a dialog stuck to the wall.
Long content: a drawer. A vessel's full record is twelve fields in nine rows, 682px of form in one column of short fields. An md dialog at its 76vh cap shows 8 of the 12 fields, with the last 190px below the fold; the footer stays, so Save is in view and what it saves isn't, and the user scrolls a box in the middle of the screen to check their own work. The 400 drawer is the whole height of the window and holds the same form with all 12 fields in view and 15px to spare above its pinned footer. On a shorter window both shrink, the dialog first: on 1280 × 720 its cap is 547. Past 720 wide, neither: that content is a page, section III.
Some tasks are too big for either surface, and the line is drawn by parameters, not taste. It needs a page when the content is wider than 720; when it has more than one region of its own, tabs, a table with its own filters, a sidebar; when the user needs a URL for it, to bookmark it, share it, come Back to it, or survive a reload; when the work lasts longer than one sitting or runs past two or three steps; and when it is the primary task rather than a side task of the thing on screen. One is enough.
| A page when | Threshold | Why an overlay fails it |
|---|---|---|
| It is wide | content past 720 | Lines run past the measure, and nothing is left of the page the overlay was keeping |
| It has regions | more than one: tabs, a filtered table, a sidebar | A second navigation inside a surface whose only navigation is × |
| It needs an address | bookmark, share, Back, reload | An overlay has no URL: Back leaves the page under it, reload loses it |
| It lasts | past one sitting, or past 2–3 steps | A closed tab or a stray Escape ends it; a draft needs somewhere to live |
| It is the task | primary, not a side task of the screen | The overlay keeps the wrong thing underneath |
A vessel's record trips three at once. It has tabs, its Sailings tab is a table with its own filters, and a dispatcher who finds the January sailings wants to send the link to the master. Drawn in a 720 dialog it is a page in a box: two regions and a table in a surface whose only way out is ×, with 10 of 14 rows in view under a title, four tabs, two filters and a search. Nothing in it has an address, so the browser's Back closes the fleet underneath rather than the dialog, a reload drops the filter, and the link that gets sent is to the fleet. As a page, Fleet › MV Tern is in the bar, the tabs are the page's own navigation, the filter is in the URL, and the table gets the window's height. The middle case is honest too. A glance at a vessel from the fleet list doesn't need the page: the inspector docks beside the list, which narrows to make room and stays live, shows the summary read-only, and Open MV Tern → goes to the page for the rest; Edit… opens the drawer. The inspector is a view of a page that exists; the dialog was a page with nowhere to live. Forms (planned) owns the multi-step flow that outgrows a dialog by its third step.
A dialog is an opaque white surface at level 3, radius lg 12, with 24px of inset on every side. Its title is 20/28 at 600, an optional description under it is 14/20 in the muted ink, the body is 14/20, and the footer ends the surface with its actions at the end, the primary last. A close button sits in the top right in addition to Cancel, never instead of it. The width comes from a class, not from the content.
The type is two voices and a title. The title is text-xl, 20/28 at 600, the step Type I §III assigned to dialog and panel titles: one step under the page's heading voice, because a dialog is a part of the page's task, not a new page. The description and the body are text-md, 14/20, a step above the 13px UI voice of the page behind, so the dialog reads as the thing in front without a size jump that makes it look like a different product. Labels and fields inside keep the UI voice, 13/20 in 32px controls, since they are the same controls the page uses. Three sizes, 20, 14 and 13, and no fourth.
The inset is 24, all the way round, and the stack inside it is 4, 20, 16, 24: 4 between the title and its description, which belong together; 20 from the header to the body; 16 between fields, the form's own gap; and 24 above the actions, the largest gap in the surface, because the footer is a separate part (the nesting rule). The radius is lg 12, the overlay step, so the dialog's corners are visibly rounder than the sm 4 controls inside it and the md 8 popovers that may open from it. The surface is opaque white with level 3's key + ambient shadow and no hairline; over a scrim, the luminance step from the dimmed page to white (2.3:1, section VII) draws the edge, and a border would only add a line.
The close button aligns its glyph, not its box. The target is 32px square, centred on the title's 28px line, and its 16px glyph sits on the inset's end edge, the same x as the primary button's end edge below. The box hangs 8px into the inset, invisible at rest. This is align the visible edge applied to an icon button: at rest the eye sees the ×, so the × is what lines up. The footer is end-aligned with the primary last, which is where Carbon ("the secondary button is on the left and the primary button is placed on the right") and Atlassian both put it, and where Popover I put a popover's. A help link goes at the footer's start, never between the buttons.
A drawer comes from the right, takes the full height of the window, and has three parts: a 56px header with a 16/24/600 title and the close button, a body that scrolls, and a footer that stays put with the actions. It is 400px wide by default, 320 narrow, 560 wide. Its attached edges are square; its leading edge carries the hairline, and the surface carries level 3. It comes from the left only when it holds navigation.
From the right, because that is where detail lives. In a left-to-right product the start of a row identifies it, and the end holds its status and actions, so the edge a drawer covers is the end: the drawer replaces the columns the user was about to look at anyway with a fuller view of the same record. The left edge belongs to Navigation, which is why a drawer from the left reads as the app's menu; use it for that and nothing else. In a right-to-left locale both flip: write the side as inset-inline-end. shadcn/ui calls the component a sheet and lets it open from any of the four edges; a product picks one edge for records and keeps it.
Full height, square where it docks. A drawer is attached to the window, so it runs from the top edge to the bottom one and takes radius none, the step for docked regions. A rounded drawer floating off the edge is a dialog in the wrong place. Its leading edge carries the hairline at .14 as well as level 3's shadow: the scrim is optional for a drawer, and without one, over a white table, the shadow alone draws a soft edge that the eye can't place to the pixel. The hairline places it.
The header and footer stay; the body scrolls between them. The title is 16/24 at 600, one step under the dialog's, because a drawer is a panel of the page rather than a decision in front of it, and the header is 56px, enough for the title and a 32px close button with 12px above and below. The footer holds the actions end-aligned, Cancel then the primary. It stays in place while the body scrolls, and it takes level 1 with its shadow cast upward only while fields continue below it, the scrolled state of Elevation II §VI; at the end of the body it is a hairline again. A drawer whose actions scroll away with the last field has hidden its own Save.
Widths are fixed, and three. 400 is the default, wide enough for two short fields in a row; 320 for a filter list or a short inspector; 560 for a record with a table inside it, and the ceiling. A drawer is never a percentage of the window: at 40% a 2560px monitor gets a 1024px drawer whose fields run to 970px, and the page beside it, the reason for choosing a drawer, shrinks to make room.
The inspector shares the header and nothing else: it pushes, and it reads. It docks beside the table at level 0, the hairline on its leading edge and no shadow, and the table reflows to make room. It squeezes before it drops: the time keeps its width because it is the identifier, the route gives up width and truncates with an ellipsis, the vessel stays, and only the trailing status column goes. Three of four columns stay readable in the 278 that is left here; in a 1360 window the table keeps 960 and nothing truncates (Data Tables owns the squeeze order of a table's columns). Its body is label/value pairs, the rest of the record that didn't fit the row, and its footer is Edit…, which opens the drawer, and Open →, which goes to the page; there is no Save, because nothing in it is typed, which is why a click on another row can swap the record at no cost. A drawer overlaps because it is transient, opened and closed inside one task; an inspector stays open across a session, and a thing that stays open shouldn't sit on top of anything. The push costs the table width, so the pane has one width, 400, or 320 for a short one, and the user doesn't drag it by default. Below about 1200px the push leaves too little table, so the inspector overlays instead, as a non-modal drawer at level 2 on the rail layer, which is the case Elevation II §VI described; or the record becomes a page.
Dialogs come in three widths, sm 400, md 560, lg 720, and none wider. They are centred horizontally and anchored vertically: the top sits at 12vh, and the dialog may grow down to 76vh, where its body scrolls instead. True vertical centring is the wrong default, because a centred dialog that grows moves its top, and dialogs grow: an error appears, a section expands, a second step is longer than the first.
Three widths, chosen by what the dialog holds. sm 400 is for a confirmation or a single field: a title, two lines of consequence, two buttons. md 560 is the default and holds a form of one column, or two short fields in a row; at 14px its 512px text box runs 73 characters a line, inside the measure Type II set. lg 720 is for content that is wide by nature, a small table or fields side by side; its prose runs to 99 characters, so paragraphs inside it are capped at the measure rather than allowed the full width. Past 720 a dialog is a page drawn in a box, with 141-character lines. If the content needs that width, it needs a page (section III). Carbon ships four responsive sizes, extra small to large, which is this scale with one more step at the bottom.
A dialog that moves while the user is reading it has broken the one promise of a modal, that nothing else is happening. Centred, the dialog above grows by 56px when the validation message appears and its top jumps 28px up, half the growth, so the title, the field the user was fixing, and everything above the message all move at once. Anchored, the top stays at 12vh and only what is below the new message moves down, which is where the user's eye isn't. A multi-step dialog re-centres at every step, and its title bounces.
The cap makes the anchor safe. Max height is 76vh, which is 100 minus twice 12: the tallest a dialog can be is exactly centred, so an anchored dialog never sits lower than a centred one would. Past that, the header and footer stay and the body scrolls between them, with the footer taking level 1 while content continues below, exactly the drawer's footer in section V. With the native element, all of it is three declarations:
Drawers have fixed widths and the full height, so they don't jump; their temptation is the percentage, which section V refused; which content suits their shape rather than a dialog's is section II. Below about 1000px a modal drawer leaves less than 600px of page and the reason for choosing it has gone: section XIII is what happens then.
The scrim is a flat dim: the shadow's own tint at 40% in light mode, black at 60% in dark mode, over the whole viewport, with no blur, no frost, and nothing on it. It is the one tinted layer the series allows, and it is allowed because it is not a surface: it carries nothing and is read through, not read. It must leave the page's text present but inactive, which this chapter measures as the page's primary text stays above 3:1, and the dialog's text beats it by at least two to one.
Forty percent is where both tests pass. Under a .40 scrim of the shadow tint, rgb(46 40 30), the page's #1a1a1a text on white composites to 7.0:1: well above 3:1, so the user can still read which fourteen sailings they are about to move, which is the reason to keep the page visible at all. The muted columns fall to 3.4:1 and recede. The dialog's own text stays at 17.4:1, two and a half times the page's, and its white surface stands 2.34:1 off the dimmed page, which is why it needs no border. At 12% the page's ink is still 13.6:1 and the dialog has no edge to speak of (1.26:1); the page looks operable and the user clicks it, and nothing happens. At 82% the page's ink drops to 1.85:1 and the context is gone, which matters most when the dialog is asking about something on the page. These are Elevation I §VIII's values; this section measures why they hold.
No blur, ever. A blurred backdrop is the scrim made into frosted glass, and the series refuses it for the reasons Elevation II §III measured: it costs a full-screen filter on every frame the dialog animates, and it removes the one thing a scrim is careful to keep, a legible page. The frame above shows what a blur leaves without blurring anything: shapes where the routes were. It also makes a false claim, that the page is still there to be read. The scrim is a dim over the page, not a material in front of it.
A scrim means a dialog. The scrim is the visible half of a state, "the page has stopped listening"; the dialog is what the page is waiting on. A scrim alone, a veil with a spinner while something loads, blocks every control on the screen and gives the user nothing to answer, no way out, and no estimate. That pattern belongs to Loading & Skeleton States (planned), and most of the time the answer there is to block only the part that is loading.
A drawer takes the scrim when it owns something the page could break. The scrim is a statement that the page must not change under the task. An edit drawer holds uncommitted work tied to one record, and without a scrim the table keeps answering clicks: a click on another row either swaps the record mid-edit or drops the edits without a word. A drawer goes without the scrim when the page is its subject and should stay usable: a filter drawer whose filters apply as they are ticked, a navigation drawer at narrow widths. The non-modal drawer sits at level 2 on the rail layer (Elevation II §VI); the modal one at level 3, under the scrim. The inspector needs no scrim for a plainer reason: it is not on top of the page at all, but docked beside it at level 0, and it holds nothing to protect (section V).
The filter drawer behind a scrim isn't wrong, only slow. Its subject is the table, and the scrim puts the table to sleep, so every change is a round trip: tick, apply, close, read the result, open again. Filters that are expensive to run and wait for an Apply can keep the scrim; filters that apply as they are ticked should leave the table live, because watching it change is their feedback. The inspector goes further than either: it holds no work and covers nothing, so the whole table stays live beside it and a click on another row shows that row. On a narrow window the navigation drawer from the left goes without one for the same reason, the page is what it navigates.
Opening a modal moves focus into it: to the first field of a form, otherwise to the least destructive action, never to a destructive one. Tab and Shift+Tab stay inside. Escape closes it, unless closing would lose what the user typed, in which case it asks. Closing returns focus to the element that opened it. Everything outside is inert. The native <dialog> opened with showModal() does all of this except the asking, which is why it is the recommendation.
Where focus lands. The WAI-ARIA dialog pattern says "generally, focus is initially set on the first focusable element," and refines it twice: for a dialog whose content is long or structured, focus a static element at its start so the reader begins at the top; for one that confirms something irreversible, focus the least destructive action. This chapter turns those into one rule per class. A form dialog focuses its first field, because typing is the next thing the user will do; that is the autofocus on Departure above, which skips the close button that comes first in the tab order. A confirmation focuses Cancel (section X), so a reflexive Enter does nothing harmful. Never the destructive button: a user who opened a confirmation with Enter is one more Enter from the consequence. MDN adds the native detail: put autofocus on the element the user will use first, and never put tabindex on the <dialog> itself.
What showModal() gives for free. MDN again: the dialog "displays in the top layer, along with a ::backdrop," and everything else in the document becomes inert, which means no clicks, no focus, no find-in-page, and gone from the accessibility tree. Escape closes it by default, firing a cancel event first that the page can intercept. On close, the browser returns focus to the element that had it before. The top layer means no z-index and no portal. One difference from the ARIA pattern: Tab past the last control visits the browser's own toolbar before coming back to the first. Focus never reaches the page, which is what the trap is for, and the address bar stays reachable, as WCAG 2.1.2 would want.
The custom case is the same contract by hand, and every line is a bug when missed. role="dialog", aria-modal="true", and aria-labelledby on its visible title; aria-describedby only for a short description, as the APG advises. inert on everything outside the overlay's root, not aria-hidden alone, which hides the page from a screen reader and leaves it reachable by Tab. Record the opener and focus it on close; if the opener has gone (the row the dialog deleted), focus what replaced it, the next row or the table, never the top of the document.
A surface with nothing typed into it closes on Escape, the ×, Cancel, and a click on the scrim. Once the user has typed, every one of those asks first, "Discard changes?", with Discard as the verb and Keep editing as the way back, except the scrim click, which is ignored. A drawer's edit saves on its button, never on close. The × never silently throws away work.
Clean surfaces light-dismiss. A dialog or drawer that holds nothing the user made is like a popover: leaving it costs nothing, so every way out should work, including the click on the scrim that Popover I §VI called light dismiss. Atlassian closes its modal on Esc and on a click in the blanket; Carbon closes a passive modal on a click outside and leaves the click out of the dismissal list for transactional ones, which is the clean/edited split made by modal type. This chapter makes it by state instead: the same dialog is light-dismissable until the first keystroke.
Edited surfaces ask, and the scrim click doesn't count. Escape, the ×, and Cancel are deliberate: the user meant to leave, and the only question is whether they meant to lose their work, so ask. A click on the scrim is the one way out that is usually an accident, a text selection dragged past the edge or a click that missed a field; answering an accident with a question is a second interruption, and ignoring it costs one deliberate action. The native dialog's default already agrees, since a modal <dialog> without closedby="any" doesn't close on a backdrop click.
The question names the loss and the answers are verbs. "Are you sure?" with Yes and No makes the user translate: sure of what, and does Yes mean "yes, I'm sure I want to leave" or "yes, keep my work"? Nielsen Norman Group asks for response options "that summarize what will happen," with "Delete file" and "Keep file" as its example, and warns that a generic prompt gets a reflexive yes. So the title names what is lost ("Discard this sailing?"), the body says what in particular, the primary is Discard, the secondary is Keep editing, and Keep editing takes focus, so that Enter, Escape, and a click on this second scrim all mean "go back." Try it in the live dialog in section VIII. The confirmation is sm, smaller than the md dialog it covers, so the user can see what they would lose round its edges.
Drawers save on their button. An edit drawer has a Save changes button and saves only when it is pressed. Saving on close turns the × and a stray Escape into commits, and makes "I was only looking" impossible to say. If the product wants edits to apply as they happen, that is a panel of toggles that apply at once, and it has no footer at all. Either way the footer never mixes commit timings, and it never puts a routine Save beside Publish, Send, or Deploy: an irreversible action leaves the drawer for its own dialog, the rule Grid II §V wrote and every chapter since inherits.
An irreversible action gets its own small dialog, sm 400. Its title names the object and the count, its body says what is lost and whether it can be undone, its primary button is the verb and is the strong button, and Cancel is the secondary and takes focus. When the stakes are high enough that a reflex could be expensive, the user types the object's name to enable the button.
Every part of the dialog repeats the consequence, because the user reads only one of them. So the title is the question with the object and the count ("Delete 14 sailings?"), the button is the answer with the same object and count ("Delete 14 sailings"), and the body adds what isn't in either: what else goes with them (312 bookings), who is affected (the passengers, by email), and whether it can be undone. "Are you sure? OK" carries none of that, and its OK, the word for acknowledging a message, is the button the user has pressed a thousand times without reading. Carbon's danger modal is the same idea: "a specific kind of transactional modal used for destructive or irreversible actions," with the primary button replaced by a danger button. This series is achromatic, so the strong button carries the verb and the verb carries the danger; in a product with colour, the destructive fill is the one place a dialog's primary turns red, and the words still have to say it.
Cancel takes focus. The verb is visually the strong button, last in the footer like every primary, but focus starts on Cancel, the least destructive action the APG asks for. The user who opened the dialog with Enter and presses Enter again has cancelled, not deleted. Type to confirm is for the rare case where a reflex would be very expensive: a whole timetable, an account, a production environment. Typing the name forces the user to read it; on every delete it becomes a toll paid without reading, NN/g's "cry wolf" warning. Where an action can be undone, don't confirm at all: do it, and offer Undo in a toast (Feedback & Notification, planned). A confirmation is for what can't be taken back.
Never open a modal over a modal, with one exception: a small confirmation raised by the dialog under it, sm over md, both in the top layer. When it opens, the scrim moves up rather than doubling: the editor dims once, the page stays dimmed once, and nothing behind the confirmation goes darker than one scrim. Popovers inside a dialog open in the top layer; a toast sits above everything at 1300 and never inside the dialog. Drawers never stack: a second drawer replaces the first and gives it a Back.
A modal over a modal is a flow that should have been a page. The second dialog in the first frame is a whole task, choosing a vessel, opened from inside another task. The user holds two contexts, sees neither fully, and has two Cancels to tell apart. Atlassian forbids it outright, calling a dialog opened from a dialog "inaccessible and confusing." The fixes are on the first dialog: the vessel becomes a select or a combobox inside it (a popover, which opens in the top layer above the dialog, as Popover I §X drew), or the dialog becomes a step of a short flow, or the task moves to a page or a drawer.
The exception is a confirmation the dialog itself raises, "Discard this sailing?" or "Delete this sailing?", and it is always smaller, sm over md, so the dialog under it shows round its edges and the user can see what the question is about. Elevation I §VIII allowed exactly this nesting and gave the confirmation its own scrim. This section refines how: the scrim moves, it doesn't double. A scrim is the visible half of a state change, "this has stopped listening." When the confirmation opens, the editor stops listening, so the editor should dim; the page was already asleep, and nothing about it changed, so it shouldn't dim further. Two stacked scrims take the page's text from 7.0:1 to 3.4:1 in light mode and to about 1.4:1 in dark, a flash of darkness that says something happened to the page when nothing did. With the native element it is one rule: while the confirmation is open, the editor's own ::backdrop clears, and the confirmation's backdrop, which sits above the editor in the top layer, does the dimming for both. The live dialog in section VIII does exactly this.
A toast is never inside a dialog. A toast confirming the dialog's action ("Sailing added", with Undo) has to be visible while the dialog closes and after, so it lives at level 4, z 1300, above every scrim, rendered at the root, and outlives the dialog that caused it. Inside the dialog, it disappears with it. Drawers never stack. A drawer opened from a drawer, the vessel from the sailing, replaces the first one's content in the same surface and puts a Back at the start of the header; the second drawer's × closes both, and Escape goes back one level before it closes anything. Two drawers side by side leave the page a strip, give the user two close buttons, and make Escape ambiguous.
A dialog fades in at base 200 with ease-enter while it scales from .96 to 1, and leaves at fast 150 with ease-exit, one step down. The scrim fades on its own, linear, base in and fast out. A drawer slides its full width from its edge at slow 300 with ease-enter and leaves at base 200 with ease-exit. Nothing animates width or height. Under reduced motion, every one of them fades in place.
These are Motion I §IX's numbers, and the reasons are that chapter's: a dialog belongs to no element on the page, so it doesn't travel, it grows 4% from its centre, enough to read as arriving; a drawer is attached to an edge, so it slides the whole of its width from that edge, 400px in 300ms, the largest movement in the product and the slowest enter. Both exits are one step down, because nobody watches a surface they have finished with. The scrim is not an object, so it fades linearly on its own layer, never as a shadow that spreads (Elevation II §IV).
Never animate width or height. A drawer that grows its width from 0 lays out its contents on every frame, wrapping and re-wrapping each paragraph as it widens, which is both the most expensive thing a browser can do per frame and the ugliest. translate moves the finished drawer as one composited layer, the compositor-only rule. A dialog that grows changes height at once, downward from its anchored top (section VI); animating it would slide the footer under the pointer. Reduced motion sets every distance to zero (Motion I §X): the dialog fades without scaling, the drawer cross-fades in place at its full width, and the durations stay. The drawer's hidden state carries opacity: 0 as well as its offset, so that with the offset at zero it is still hidden.
At 640px and under, an md or lg dialog becomes a sheet from the bottom: full width, radius lg on its top corners only, its actions full-width at the foot. A drawer becomes a full-screen page with a Back. An sm dialog, the confirmation, stays a dialog, 16px from each side. Nothing is simply shrunk.
A sheet, because the thumb is at the bottom. A centred dialog on a phone floats in the middle with its actions out of easy reach and its text squeezed to 295px between 24px insets and 16px margins. A sheet uses the full width, puts its actions where the thumb is, and keeps the page visible above it, dimmed, so the user still sees what they're adding to. Its top corners take lg 12 and its bottom corners none, since it is docked to the bottom edge, the same docked/free split the drawer has.
A drawer becomes a page. On a 375px screen there is no "beside": a 320px drawer leaves a 55px strip of page that can't be read or used, and the scrim over it is a tap target the size of a thumbnail. The drawer's content becomes a full-screen view with a Back in the header that returns to the list, which is what Elevation II §VI said happens to the frame on a phone: nothing slides over content without also taking it over. The sm confirmation stays a dialog, 343px wide with 16px each side, because it is short, its two buttons fit side by side, and keeping the dimmed selection visible behind it is the point. The live dialog in section VIII does the md-to-sheet change at 640px; on a phone it rises from the bottom.
In dark mode the scrim goes to black at 60%, the dialog climbs the ramp to level 3's #2f2f2f with a white edge brighter at the top, and the drawer keeps the hairline on its leading edge, white at .14. The page's text under the scrim falls to about 3:1, the same "present but asleep" the light scrim gives, and the dialog's own text stays above 11:1.
The scrim does more work in the dark, because the dialog's surface does less. In light mode the dialog is white over a dimmed page, a 2.34:1 step that draws its edge by itself. In dark mode the level-3 surface, #2f2f2f, sits only 1.48:1 off the dimmed page, so the separation has to come from the text instead: black at 60% takes the page's #ecebe8 ink from 14.6:1 to 3.05:1, while the dialog's own ink stays at 11.2:1 and its muted ink at 6.2:1, so the dialog is by far the brightest thing on the screen. A 40% tint, ported from light mode, barely registers on a page that is already dark, as Elevation II §IX found. The edge does the rest: Elevation I §VI's level 3 edge, white at 9% on the sides and 14% on the top, drawn inside the surface so it doesn't add to the width. The ported version puts the dialog on the page's own tone, #1a1a1a, with a paper-coloured shadow that can't be seen, so its only edge is a 1.07:1 step.
The inspector's one edge is its hairline, inverted to white at .14, the inverse token, 1.53:1 on #1a1a1a. Docked at level 0 it shares the page's tone and has no shadow, so the hairline is all that separates it; the light tint, ported, is 1.02:1 and the pane runs into the table. Drawers keep the same white hairline, on #2f2f2f for a modal one, where a shadow does almost nothing on a dark page. Everything stays opaque: a translucent dark dialog lets the bright text of the page bleed through under its own, which is worse in dark mode than in light, and the scrim stays a flat dim with no blur in both.
Decide each blocking or sliding surface in this order, once per component; each step assumes the ones before it.
Steps one to three, eight and ten are the judgement; the rest are contracts written once. The audit: for every dialog, ask whether its fields are checked against the page; for every drawer, whether its content is long or only wide; Tab through every dialog, press Escape, and see where focus lands; type into each and try every way out; trigger its errors on a 1280 × 720 window; open one dialog from another and count the dims; read only the button of every confirmation.
Feedback & Notification (planned) takes the toast that confirms what a dialog did, and the Undo that makes many confirmations unnecessary. Forms (planned) takes multi-step dialogs and the validation that makes them grow. Loading & Skeleton States (planned) takes the veil. A Part II would take the command palette, the full-screen takeover, and the wizard. Every one of them still answers two questions: does this need to block, and what is lost if it closes?
Part I of Overlays: Modal & Drawer.
A dialog asks in the middle and waits. A drawer works beside the page it needs and leaves the way it came.