Dustin Johnson ← Design Primitives
Design Primitive Reference · Part I · October 2026

Overlays: Modal & Drawer

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.

I. Block or Slide

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.

Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
  • 12:20Ostrand – CarrowMV Tern
Edit sailing 07:40
Departure07:40
Arrival08:25
VesselMV Tern
RouteOstrand – Hollin Quay
CancelSave changes
Sailing 07:40
Departure07:40
Arrival08:25
VesselMV Tern
RouteOstrand – Hollin Quay
CancelSave changes
Dialog 560 · covers all 8 rows · the 08:15 it must not clash with is under the dialog Drawer 400 · the departure and route of all 8 rows stay in view, legible under the scrim at 7.0:1 An edit checked against the rows, in a dialog · Wrong An edit checked against the rows, in a drawer · Right
14 selectedMove…Delete…
  • 07:40Ostrand – Hollin QuayMV TernOn time
  • 08:15Carrow – FenmouthMV SkuaOn time
  • 09:05Ostrand – CarrowMV FulmarDelayed 10
  • 09:50Hollin Quay – OstrandMV TernOn time
  • 10:30Fenmouth – CarrowMV GannetOn time
  • 11:10Ostrand – Hollin QuayMV SkuaCancelled
  • 11:45Carrow – FenmouthMV FulmarOn time
  • 12:20Ostrand – CarrowMV TernOn time
Delete 14 sailings?
The sailings and their 312 bookings are removed, and the passengers are told by email. This can't be undone.
CancelDelete 14 sailings
Delete 14 sailings?
The sailings and their 312 bookings are removed, and the passengers are told by email. This can't be undone.
CancelDelete 14 sailings
No scrim, so the table looks live and is: a click on a row changes the selection the question is about · the verb sits 295px below the question Scrim · page inert · 400 wide · the verb 106px below the question · Cancel focused An irreversible confirmation in a drawer · Wrong An irreversible confirmation in a dialog · Right
Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
  • 12:20Ostrand – CarrowMV Tern
Edit MV Tern
NameMV Tern
Passengers240
Crew12
Home portOstrand
CancelSave changes
MV Tern
NameMV Tern
Passengers240
Crew12
Home portOstrand
CancelSave changes
Dialog 560 · 4 fields, none of them read off the timetable · opens where the eye already is · the scrim says the page will wait Drawer 400 · the same 4 fields at the right edge · keeps 8 rows in view that nothing in the form refers to A self-contained edit in a dialog · Right The same edit in a drawer · Works, but the page it keeps is irrelevant

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 dialogDrawerInspector
ForA task whose fields stand on their own: a create, a self-contained edit, a confirmation, an irreversible choice; content wide and short, up to 720A task checked against the page; a long one-column form; a run of recordsReading one record beside the list
BlocksAlwaysAlways when it holds work, and an edit always does; only live filters and narrow navigation leave the page liveNever
Sizesm 400 · md 560 · lg 720, by content400 · narrow 320 · wide 560; full height400 · 320
Scrimrgb(46 40 30 / .40) · dark black .60Same when it holds work; none for live filtersNone
DismissalEscape, ×, Cancel; the scrim only when nothing has been typedEscape, ×, the scrim; asks first only when editedClose, or stays open
FocusIn on open, trapped, back to the openerIn on open; trapped when modal; back to the openerNot moved on open
Layerlevel 3 · modal 1200 · top layerlevel 3 · drawer 1100 · live filters level 2, rail 200level 0 · in flow · hairline
Motionin base 200 · out fast 150 · scale .96 → 1in slow 300 · out base 200 · its full widthnone, 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.

Ask whether the page is consulted, what shape the content is, and whether it is one task or a run. "It's an edit" answers none of them; when the page can wait, the dialog is the default.

II. The Shape of the Content

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.

Viewport 1360 × 850 · drawn at ½
Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
  • 12:20Ostrand – CarrowMV Tern
  • 12:55Hollin Quay – OstrandMV Gannet
  • 13:40Fenmouth – CarrowMV Skua
  • 14:25Ostrand – Hollin QuayMV Tern
  • 15:10Carrow – FenmouthMV Fulmar
  • 15:50Ostrand – CarrowMV Gannet
  • 16:35Hollin Quay – OstrandMV Skua
Top 12vh · 102 sm 400 × 200 md 560 × 340 lg 720 × 480 Cap 76vh · 646 tall · bottom at 748 560 400 320 Header 56 Body 738 Footer 56
Dialog · 400 / 560 / 720 across, top at 102 · drawn at typical heights, 200 / 340 / 480 · capped at 646, where the body scrolls · even at the cap, lg is wider than tall Drawer · 320 / 400 / 560 across · always 850 tall · the 400 is 2.1× as tall as it is wide; 560 already covers 41% of the window The two envelopes on one 1360 × 850 window · Wide and short, narrow and tall
Viewport 1360 × 850 · drawn at ½
Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
  • 12:20Ostrand – CarrowMV Tern
  • 12:55Hollin Quay – OstrandMV Gannet
  • 13:40Fenmouth – CarrowMV Skua
  • 14:25Ostrand – Hollin QuayMV Tern
  • 15:10Carrow – FenmouthMV Fulmar
  • 15:50Ostrand – CarrowMV Gannet
  • 16:35Hollin Quay – OstrandMV Skua
Fares · Ostrand – Hollin QuayEvery sailing on the route, Winter 2026
Valid fromMon 4 Jan
Valid toSun 28 Mar
Peak hours07:00–09:30 weekdays
TicketOff-peak singlePeak singleReturn10 journeysFoot passenger, adult£9.80£14.20£24.00£84.00Foot passenger, child£4.90£7.10£12.00£42.00Car and driver, up to 5 m£38.50£52.00£92.00£320.00Van or motorhome, 5–7 m£61.00£78.00£139.00£520.00Bicycle£2.00£2.00£4.00£16.00
CancelSave fares
Drawer 560 · 512 of body · 2 of 5 ticket names and 1 header wrap · price boxes 83 wide · covers 41% of a timetable nothing in the form refers to · Weak lg 720 · 672 of body · every name on one line · price boxes 111 wide · 466 tall, well under the 646 cap · Right A fare table in a 560 drawer · Weak The same fare table in an lg 720 dialog · Right
Viewport 1360 × 850 · drawn at ½
Fleet · 4 vesselsAdd vessel
  • MV Tern240 passengersOstrandIn service
  • MV Skua180 passengersFenmouthDry dock to 14 Feb
  • MV Fulmar220 passengersCarrowIn service
  • MV Gannet160 passengersHollin QuayIn service
Edit MV Tern
NameMV Tern
IMO number9214873
Call signMBTR7
Home portOstrand
Passengers240
Crew12
Vehicle lanes186 m
MasterA. Strand
Built2004
Next surveyMar 2027
Radio licenceOST-0412
Notes for the crewBow door seal replaced Oct 2026. Ramp limit 4.2 m.
CancelSave changes
md 560 at the 76vh cap, 646 tall · 8 of 12 fields in view, the last 190px below the fold · Save is visible, what it saves isn't · Weak Drawer 400 · all 12 fields in 9 rows, 682 of form in 697 of body, 15 to spare · Save pinned at the foot · Right A vessel's full record in an md dialog · Weak The same record in a 400 drawer · Right

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.

Wide and short is a dialog, narrow and tall is a drawer. Side by side or tabular: a dialog, up to 720. A long single column: a drawer. Wider than 720: a page.

III. When It Needs a Page

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.

Viewport 1360 × 850 · drawn at ½
Fleet · 4 vesselsAdd vessel
  • MV Tern240 passengersOstrandIn service
  • MV Skua180 passengersFenmouthDry dock to 14 Feb
  • MV Fulmar220 passengersCarrowIn service
  • MV Gannet160 passengersHollin QuayIn service
Fleet ›MV TernEdit details
MV TernRo-ro passenger ferry · 240 passengers · home port Ostrand
DetailsSailings · 46Crew · 12Surveys
Route: allJanuarySearch sailings14 of 46
  • Mon 4 Jan07:40Ostrand – Hollin Quay184 of 240 booked
  • Mon 4 Jan09:50Hollin Quay – Ostrand151 of 240 booked
  • Mon 4 Jan12:20Ostrand – Carrow96 of 240 booked
  • Tue 5 Jan07:40Ostrand – Hollin Quay201 of 240 booked
  • Tue 5 Jan09:50Hollin Quay – Ostrand143 of 240 booked
  • Tue 5 Jan12:20Ostrand – Carrow88 of 240 booked
  • Wed 6 Jan07:40Ostrand – Hollin Quay176 of 240 booked
  • Wed 6 Jan09:50Hollin Quay – Ostrand162 of 240 booked
  • Wed 6 Jan12:20Ostrand – Carrow104 of 240 booked
  • Thu 7 Jan07:40Ostrand – Hollin Quay190 of 240 booked
  • Thu 7 Jan09:50Hollin Quay – Ostrand139 of 240 booked
  • Thu 7 Jan12:20Ostrand – Carrow91 of 240 booked
  • Fri 8 Jan07:40Ostrand – Hollin Quay212 of 240 booked
  • Fri 8 Jan09:50Hollin Quay – Ostrand170 of 240 booked
Close
MV Tern
Passengers240
Crew12
MasterA. Strand
Next surveyMar 2027
Next sailings
Mon 4 Jan 07:40Ostrand – Hollin Quay
Mon 4 Jan 09:50Hollin Quay – Ostrand
Open MV Tern →Edit…
720 × 646 · a title, 4 tabs, 2 filters, a search and a table: 10 of 14 rows in view · no URL: Back leaves the fleet, reload drops the filter · Wrong Fleet › MV Tern in the bar · all 14 rows in view against 10 · tabs and filter in the URL, so Back, reload and a shared link all land here · Right Inspector 400, docked · level 0, hairline, no shadow · the fleet list reflows 1360 → 960 and stays live: a click on MV Skua shows MV Skua · Edit… opens the drawer · Open MV Tern → goes to the page A vessel record in a 720 dialog · Wrong: a page in a box The same record as a page · Right Its summary in a docked inspector, the page one click on · Right for a glance
A page whenThresholdWhy an overlay fails it
It is widecontent past 720Lines run past the measure, and nothing is left of the page the overlay was keeping
It has regionsmore than one: tabs, a filtered table, a sidebarA second navigation inside a surface whose only navigation is ×
It needs an addressbookmark, share, Back, reloadAn overlay has no URL: Back leaves the page under it, reload loses it
It lastspast one sitting, or past 2–3 stepsA closed tab or a stray Escape ends it; a draft needs somewhere to live
It is the taskprimary, not a side task of the screenThe 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.

Tabs, its own filters, an address, a second sitting, or being the thing the user came for: any one makes it a page. An inspector may summarise it and link there.

IV. Anatomy of the Dialog

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.

New timetableSailings are added once it exists.
NameWinter 2027
First sailingMon 4 Jan 2027
CancelCreate timetable
Title · 20/28/600 Desc · 14/20 muted Label · 13/20 Field · 32 · strong Inset · 24 all round Stack · 4·20·16·24 Width · 400 · sm Close · 32 box
glyph on inset
Radius · 12 lg Surface · #fff
opaque
Shadow · level 3 Footer · end
primary last · 8
Close glyph's end edge and the primary's end edge on one line, 0px apart · title 28px line, close target 32px, centred on it · 400 × 308 The dialog at 1:1 · Measured in the browser

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.

Twenty on twenty-eight for the title, fourteen for the words, the page's own controls inside, twenty-four of inset, twelve of radius, and the decision at the end.

V. Anatomy of the Drawer

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.

Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV TernOn time
  • 08:15Carrow – FenmouthMV SkuaOn time
  • 09:05Ostrand – CarrowMV FulmarDelayed 10
  • 09:50Hollin Quay – OstrandMV TernOn time
  • 10:30Fenmouth – CarrowMV GannetOn time
  • 11:10Ostrand – Hollin QuayMV SkuaCancelled
  • 11:45Carrow – FenmouthMV FulmarOn time
  • 12:20Ostrand – CarrowMV TernOn time
  • 12:55Hollin Quay – OstrandMV GannetOn time
  • 13:40Fenmouth – CarrowMV SkuaOn time
  • 14:25Ostrand – Hollin QuayMV TernOn time
Sailing 07:40
Departure07:40
Arrival08:25
RouteOstrand – Hollin Quay
VesselMV Tern
MasterA. Strand
Notes for the crewSkips Carrow on weekdays.
Fare bandPeak
CancelSave changes
Sailing 07:40
Departure07:40
Arrival08:25
RouteOstrand – Hollin Quay
VesselMV Tern
MasterA. Strand
Bookings184 of 240
Notes for the crewSkips Carrow on weekdays
Open →Edit…
Radius 0 · docked Header 56 · title 16/24 · 600 Hairline .14 + level 3 Width 400 · 320 · 560 Body scrolls · 13/20 · inset 24 Full height Footer stays · level 1 up Close 32 Header 56 · title 16/24 · 600 Level 0 · hairline .14 · no shadow Width 400 · 320 · not resizable Read-only · Edit opens the drawer Table 678 → 278 · route truncates Footer · Open →, Edit… · no Save Close 32
Drawer 400 × the full frame · header 56 · footer 57, casting upward while the body continues · no radius · scrim behind: modal, z drawer 1100 No scrim, no shadow · level 0, in flow · the table squeezes to 278 and stays live: time and vessel keep their width, the route truncates, status drops · at 1360 the table keeps 960 and nothing truncates · a click on another row swaps the record The drawer at 1:1 · Right The inspector at 1:1 · A pane beside the table, not a drawer over it · Right

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.

A drawer is docked: full height, square corners, the hairline on the edge it slides from, its actions pinned at the foot. Four hundred wide unless it has a reason.

VI. Size & Position on Large Viewports

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.

Viewport 1360 × 850 · drawn at ½
Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
  • 12:20Ostrand – CarrowMV Tern
  • 12:55Hollin Quay – OstrandMV Gannet
  • 13:40Fenmouth – CarrowMV Skua
  • 14:25Ostrand – Hollin QuayMV Tern
  • 15:10Carrow – FenmouthMV Fulmar
  • 15:50Ostrand – CarrowMV Gannet
  • 16:35Hollin Quay – OstrandMV Skua
  • 17:20Fenmouth – CarrowMV Tern
  • 18:05Ostrand – Hollin QuayMV Fulmar
  • 18:50Carrow – FenmouthMV Gannet
  • 19:30Ostrand – CarrowMV Skua
Timetable notesShown to crews with every sailing in Winter 2026.
The winter timetable runs from Monday 4 January to Sunday 28 March. Late sailings on the Ostrand – Hollin Quay route skip the Carrow stop on weekdays, and the 07:40 moves to MV Tern while MV Skua is in dry dock at Fenmouth. Crews rostered on the old pattern keep their shifts; only the vessel changes.
CancelSave notes
sm 400 · 352px of text · 51 characters a line · confirmations and one-field creates · Right md 560 · 512px of text · 73 characters a line, inside the measure · forms and the default · Right lg 720 · 672px of text · 99 characters a line: prose stays capped at 37em inside it · tables and side-by-side fields · Right 1040 · 992px of text · 141 characters a line · a page in a box · Wrong Three widths and the one past the ceiling · Top anchored at 12vh

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.

Viewport 1360 × 850 · drawn at ½
Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
  • 12:20Ostrand – CarrowMV Tern
  • 12:55Hollin Quay – OstrandMV Gannet
  • 13:40Fenmouth – CarrowMV Skua
  • 14:25Ostrand – Hollin QuayMV Tern
  • 15:10Carrow – FenmouthMV Fulmar
  • 15:50Ostrand – CarrowMV Gannet
  • 16:35Hollin Quay – OstrandMV Skua
  • 17:20Fenmouth – CarrowMV Tern
  • 18:05Ostrand – Hollin QuayMV Fulmar
  • 18:50Carrow – FenmouthMV Gannet
  • 19:30Ostrand – CarrowMV Skua
Add a sailing
Departure08:15
VesselMV Skua
MV Skua already leaves Carrow at 08:15. Pick another time or vessel.
RouteOstrand – Carrow
CancelAdd sailing
top moved 28 up top stayed at 102
Centred · 286 tall · top at 282 Centred · grew 56 to 342 · top moved 282 → 254, 28px up · the field being corrected moved with it · Wrong Anchored · top at 102, 12vh · 286 tall Anchored · grew 56 to 342 · top stayed at 102 · title and field still where the eye left them · Right The same dialog, growing · Toggle the error

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:

dialog { width: min(560px, 100vw - 32px); /* the class's width; never a percentage */ margin: 12vh auto auto; /* centred across, anchored down */ max-height: 76vh; /* 100 − 2 × 12: the tallest is exactly centred */ }

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.

Pick the width from the content, never wider than 720. Anchor the top at 12vh and cap the height at 76vh, so a growing dialog grows down and never moves what the user is reading.

VII. The Scrim

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.

14 selectedMove…Delete…
  • 07:40Ostrand – Hollin QuayMV TernOn time
  • 08:15Carrow – FenmouthMV SkuaOn time
  • 09:05Ostrand – CarrowMV FulmarDelayed 10
  • 09:50Hollin Quay – OstrandMV TernOn time
  • 10:30Fenmouth – CarrowMV GannetOn time
  • 11:10Ostrand – Hollin QuayMV SkuaCancelled
  • 11:45Carrow – FenmouthMV FulmarOn time
  • 12:20Ostrand – CarrowMV TernOn time
Move 14 sailings?
The selected sailings move to Winter 2027 with their bookings. You can move them back until the timetable is published.
CancelMove 14 sailings
Page ink 13.6:1 · dialog 17.4:1, only 1.3× the page · dialog vs page 1.26:1 · the page looks live · Wrong Page ink 17.4 → 7.0:1 · muted 5.3 → 3.4:1 · dialog 17.4:1, 2.5× the page · dialog vs page 2.34:1 · Right Page ink 1.85:1 · the sailings being moved can't be read · the dialog floats in a void · Wrong What a blur leaves: shapes, no words · the routes being moved can't be checked, for a full-screen filter on every frame · Wrong A dim with nothing to answer · the page is blocked and nothing says why or for how long · Wrong; it belongs to Loading One dialog, five backdrops · The scrim's alpha measured

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).

Winter 2026 · Ostrand4 of 9 sailingsFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
  • 12:20Ostrand – CarrowMV Tern
  • 12:55Hollin Quay – OstrandMV Gannet
Sailing 07:40
Departure07:55
Arrival08:40
VesselMV Tern
Unsaved · departure 07:40 → 07:55, arrival 08:25 → 08:40
CancelSave changes
Sailing 09:05
RouteOstrand – Carrow
VesselMV Fulmar
MasterJ. Rook
Booked131 of 220
StatusDelayed 10
Open →Edit…
Filter sailings
RouteOstrand – Hollin QuayOstrand – CarrowCarrow – FenmouthHollin Quay – OstrandFenmouth – CarrowDeparts
From 07:00
To 13:00
ClearShow 4 sailings
Clear all
No scrim · the table still answers clicks · a click on 09:05 swaps the drawer to 09:05, and the unsaved 07:55 is lost, or kept for a record no longer on screen · Wrong Scrim · level 3 · the click on 09:05 lands on the scrim and is ignored while edited · the 07:40 can't change under the task · Right No scrim, no shadow · docked at level 0, the table squeezed to time, route and vessel · a click on 09:05 shows 09:05 · nothing held, nothing covered · Right Scrim · the table the filters act on is asleep under it and hasn't changed · Show 4 sailings, read, reopen to adjust: two extra steps a try · Weak No scrim · level 2 · each tick applies at once and the table answers beside it: 4 of 9 · Clear all, no Apply · Right An edit drawer without a scrim · Wrong An edit drawer with a scrim · Right A docked inspector · Right: it holds nothing, so the row click costs nothing A filter drawer behind a scrim · Weak A live filter drawer without a scrim · Right

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.

The scrim is a flat dim, not a surface: 40% of the shadow tint, no blur, under a dialog or a drawer that owns work the page could break. When the page is the drawer's subject, no scrim: the page stays live.

VIII. Focus

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.

Add a sailingOstrand – Carrow, Winter 2026
Departure07:55
Arrival08:40
VesselMV Tern
CancelAdd sailing
1 2 3 4 5 6 focus lands here on open Tab from 6 → 1 · Shift+Tab from 1 → 6 · page inert
Order follows reading order: the close button first, then the fields, then the footer · initial focus skips to the first field Focus through one dialog · Numbered in tab order
A real <dialog> opened with showModal(). Tab around it; press Escape. Type something first and try Escape, ×, Cancel, or a click on the scrim.
The native dialog, live · Right

Add a sailing

Ostrand – Carrow, Winter 2026

Discard this sailing?

The times and vessel you entered are not saved.

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.

<!-- Native: trap, Escape, inert, top layer, focus return. --> <button id="add">Add a sailing</button> <dialog id="add-sailing" aria-labelledby="add-t"> <form method="dialog"> <!-- submitting closes it --> <h2 id="add-t">Add a sailing</h2> <input name="dep" autofocus> <!-- first field, not the close button --> … </form> </dialog> add.addEventListener('click', () => dialog.showModal()); dialog.addEventListener('cancel', (e) => { // Escape: ask only if something would be lost if (form.dirty) { e.preventDefault(); confirmDiscard.showModal(); } }); /* Without <dialog>: role="dialog" aria-modal="true" aria-labelledby on the surface; `inert` on every sibling of the overlay root; a keydown handler that wraps Tab; Escape on the surface; store document.activeElement and .focus() it on close. */

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.

In to the first field, or to the safe button; round and round inside; Escape to leave, asking only if work would be lost; and back to the button that opened it.

IX. Dismissal & Unsaved Work

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.

Dialog, cleanDialog, editedDrawer, cleanDrawer, edited EscapeClosesAsksClosesAsks × / CancelClosesAsksClosesAsks Click on the scrimClosesIgnoredClosesIgnored The primaryCommitsCommitsCommitsSaves, then closes Inspector: row click——Swaps the record—
What each way out does · Light dismiss while clean, ask once edited

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.

Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
  • 12:20Ostrand – CarrowMV Tern
  • 12:55Hollin Quay – OstrandMV Gannet
  • 13:40Fenmouth – CarrowMV Skua
Add a sailingOstrand – Carrow, Winter 2026
Departure07:55
Arrival08:40
VesselMV Tern
CancelAdd sailing
Are you sure?
Unsaved changes will be lost.
NoYes
Discard this sailing?
The times and vessel you entered are not saved.
Keep editingDiscard
Closed · 3 fields gone · nothing asked
One click on × · 07:55, 08:40 and MV Tern discarded · no undo · Wrong "Yes" to which: to being sure, or to the loss? · focus on the destructive answer · Wrong The verb is the answer · Keep editing focused, so Enter and Escape both keep the work · Right Leaving a dialog with three fields filled

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.

Until the user types, every way out works. After, every deliberate way out asks with a verb, and an accidental one does nothing.

X. The Destructive Confirmation

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.

14 selectedMove…Delete…
  • 07:40Ostrand – Hollin QuayMV TernOn time
  • 08:15Carrow – FenmouthMV SkuaOn time
  • 09:05Ostrand – CarrowMV FulmarDelayed 10
  • 09:50Hollin Quay – OstrandMV TernOn time
  • 10:30Fenmouth – CarrowMV GannetOn time
  • 11:10Ostrand – Hollin QuayMV SkuaCancelled
  • 11:45Carrow – FenmouthMV FulmarOn time
  • 12:20Ostrand – CarrowMV TernOn time
  • 12:55Hollin Quay – OstrandMV GannetOn time
Are you sure?
This action cannot be undone.
CancelOK
Delete 14 sailings?
The 14 sailings on Ostrand – Carrow from 4 to 17 January are removed. Their 312 bookings are cancelled and the passengers told by email. This can't be undone.
CancelDelete 14 sailings
Delete Winter 2026?
All 1,284 sailings in the timetable are removed, and 9,610 bookings cancelled. This can't be undone.
CancelDelete timetable
No object, no count, no consequence · "OK" to what · focus on OK, one Enter from the loss · Wrong Title names object and count · body says what goes and that it's final · the verb is the primary · Cancel focused · Right Type the name and the button wakes · for losses counted in thousands, not for every delete · Right Confirming an irreversible delete

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.

Name the thing and the number in the title, say what goes with it in the body, put the verb on the button, and start on Cancel.

XI. Stacking

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.

Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
  • 12:20Ostrand – CarrowMV Tern
  • 12:55Hollin Quay – OstrandMV Gannet
  • 13:40Fenmouth – CarrowMV Skua
Add a sailingOstrand – Carrow, Winter 2026
Departure07:55
Arrival08:40
VesselMV Tern
CancelAdd sailing
Choose a vesselVessels free at 07:55 on Ostrand – Carrow
MV TernFree
MV GannetFree
MV FulmarFree after 09:00
CancelChoose
Discard this sailing?
The times and vessel you entered are not saved.
Keep editingDiscard
Sailing 07:40
VesselMV Tern
RouteOstrand – Hollin Quay
CancelSave changes
MV Tern
Capacity240
Home portOstrand
Next surveyMar 2027
‹ Sailing 07:40MV Tern
Capacity240
Home portOstrand
Next surveyMar 2027
Two scrims · page ink 17.4 → 3.4:1, dimmed twice for one state change · the first dialog hidden under a second of the same size · Wrong One scrim, moved above the editor · page ink stays 7.0:1 · editor dims to 7.0:1, visibly asleep · sm over md, the editor's edges show · Right Two drawers, two shadows, two × · the first a 40px sliver · which one does Escape close? · Wrong The vessel replaces the sailing in the same drawer · Back returns to it · one × · Right Overlays opened from overlays

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.

/* Two modals open, one dim: the lower dialog's backdrop clears while the confirm is open. */ body:has(#discard[open]) #add-sailing::backdrop { background: transparent; }

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.

One modal at a time, and one dim. A confirmation may sit on its own dialog; the scrim moves up to meet it and the page stays as dim as it was.

XII. Motion

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.

Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
Move 14 sailings?
They move to Winter 2027 with their bookings.
CancelMove 14 sailings
Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
Sailing 07:40
Skips Carrow on weekdays. Moves to MV Tern while MV Skua is in dry dock at Fenmouth.
VesselMV Tern
Dialog: opacity + scale .96 → 1, base 200 in, fast 150 out · scrim: opacity, linear · drawer: translate 400px, slow 300 in, base 200 out · Right transition: all 300ms ease, both ways · dialog zooms from .5 · drawer animates width 0 → 400, re-wrapping its text on every frame · Wrong Open and close, then in slow motion. The wrong drawer reflows its paragraph line by line as it widens.

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.

dialog { opacity: 0; scale: calc(1 - .04 * var(--dist)); transition: opacity 150ms var(--ease-exit), scale 150ms var(--ease-exit), overlay 150ms allow-discrete, display 150ms allow-discrete; } dialog[open] { opacity: 1; scale: 1; transition-duration: 200ms; transition-timing-function: var(--ease-enter); } @starting-style { dialog[open] { opacity: 0; scale: calc(1 - .04 * var(--dist)); } } .drawer { translate: calc(100% * var(--dist)) 0; opacity: var(--dist); /* 0 under reduced motion */ transition: translate 200ms var(--ease-exit), opacity 200ms var(--ease-exit); } .drawer.open { translate: 0; opacity: 1; transition-duration: 300ms; transition-timing-function: var(--ease-enter); } @media (prefers-reduced-motion: reduce) { :root { --dist: 0; } }
The dialog grows four percent and fades; the drawer slides its own width; the scrim simply dims. In at one step, out at the step below, and nothing ever changes size on the way.

XIII. Reducing to Mobile

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.

Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin Quay
  • 08:15Carrow – Fenmouth
  • 09:05Ostrand – Carrow
  • 09:50Hollin Quay – Ostrand
  • 10:30Fenmouth – Carrow
  • 11:10Ostrand – Hollin Quay
  • 11:45Carrow – Fenmouth
  • 12:20Ostrand – Carrow
  • 12:55Hollin Quay – Ostrand
  • 13:40Fenmouth – Carrow
Add a sailing
Departure07:55
VesselMV Tern
CancelAdd sailing
md → sheet · 375 wide · radius 12 on top · actions 160 each md shrunk to 343 · floats mid-screen · thumb-far actions
Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin Quay
  • 08:15Carrow – Fenmouth
  • 09:05Ostrand – Carrow
  • 09:50Hollin Quay – Ostrand
  • 10:30Fenmouth – Carrow
  • 11:10Ostrand – Hollin Quay
  • 11:45Carrow – Fenmouth
  • 12:20Ostrand – Carrow
  • 12:55Hollin Quay – Ostrand
  • 13:40Fenmouth – Carrow
‹ Timetable07:40
Departure07:40
VesselMV Tern
RouteOstrand – Hollin Quay
CancelSave changes
Drawer → page · Back to the timetable · no scrim to tap Drawer 320 · a 55px strip of page · nothing in it usable
14 selectedMove…Delete…
  • 07:40Ostrand – Hollin Quay
  • 08:15Carrow – Fenmouth
  • 09:05Ostrand – Carrow
  • 09:50Hollin Quay – Ostrand
  • 10:30Fenmouth – Carrow
  • 11:10Ostrand – Hollin Quay
  • 11:45Carrow – Fenmouth
  • 12:20Ostrand – Carrow
  • 12:55Hollin Quay – Ostrand
  • 13:40Fenmouth – Carrow
Delete 14 sailings?
Their 312 bookings are cancelled. This can't be undone.
CancelDelete 14
sm stays a dialog · 343 wide · 16 each side Confirm as a full page · the selection gone from view
Phones at 375 · drawn at .6 · Right The desktop overlays, made to fit · Wrong

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.

On a phone a form dialog becomes a sheet, a drawer becomes a page, and a confirmation stays exactly what it was.

XIV. Dark Mode

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.

Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
Move 14 sailings?From Winter 2026 to Winter 2027
Their bookings move with them.
CancelMove 14 sailings
Winter 2026 · OstrandFilterAdd sailing
  • 07:40Ostrand – Hollin QuayMV Tern
  • 08:15Carrow – FenmouthMV Skua
  • 09:05Ostrand – CarrowMV Fulmar
  • 09:50Hollin Quay – OstrandMV Tern
  • 10:30Fenmouth – CarrowMV Gannet
  • 11:10Ostrand – Hollin QuayMV Skua
  • 11:45Carrow – FenmouthMV Fulmar
Sailing 07:40
VesselMV Tern
RouteOstrand – Hollin Quay
MasterA. Strand
Booked184 of 240
Light · dialog ink 17.4:1 · page ink under the .40 tint 7.0:1 · dialog vs page 2.34:1 · inspector at level 0: hairline .14, 1.31:1, no shadow Dark · dialog #ecebe8 on #2f2f2f 11.2:1, muted 6.2:1 · page ink under black .60, 14.6 → 3.05:1 · dialog 3.7× the page · inspector at level 0 on #1a1a1a: edge white .14, 1.53:1, no shadow Ported · dialog on #1a1a1a, the page's own tone, 1.07:1 off the dimmed page · shadow invisible · scrim a 40% tint that barely dims · the inspector's edge 1.02:1, gone · Wrong Light · The reference · Right Dark · Ramp, edge, black scrim · Right Dark · Light values ported · Wrong

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.

In the dark the dialog climbs to #2f2f2f with a brighter top edge, the scrim goes to 60% black, and the drawer draws its edge in light.

XV. The Checklist

Decide each blocking or sliding surface in this order, once per component; each step assumes the ones before it.

1
Ask the three questionsThe page is consulted while working: a drawer. Fields that stand on their own: a dialog, the default. A run of edits: a drawer. Reading record after record beside the list: an inspector, docked, holding no work. Anything anchored and light: a popover.
2
Fit the shapeDialog up to 720 across and 646 tall on an 850 window; drawer up to 560 across and about 738 of body. Side by side or tabular: a dialog. A long single column that would scroll a dialog: a drawer.
3
Check it isn't a pageWider than 720, more than one region, needs a URL, outlasts a sitting or two or three steps, or is the primary task: a page. An inspector may summarise it with Open.
4
Build it from the tokensDialog: #fff, level 3, radius 12, inset 24, title 20/28/600, body 14/20, footer end-aligned. Drawer: right edge, full height, radius 0, hairline .14 + level 3, header 56, title 16/24/600.
5
Pick the width from the classDialog sm 400, md 560, lg 720, never wider. Drawer 400, 320, 560, never a percentage.
6
Anchor itCentred across, top at 12vh, max height 76vh with the body scrolling and the footer taking level 1 while content continues.
7
Dim the page, flatShadow tint .40 light, black .60 dark. No blur. Never alone, never under an inspector.
8
Decide the drawer's scrimA scrim when the drawer owns uncommitted work the page could break: level 3. None when the page is its subject and stays live, live filters and narrow navigation: level 2. The inspector is no drawer: docked at level 0.
9
Route focusFirst field, or the least destructive action. Trapped inside, page inert, Escape closes, back to the opener. Use <dialog> with showModal().
10
Guard the user's workClean: every way out closes. Edited: Escape, ×, Cancel ask "Discard changes?" with Keep editing focused; the scrim click is ignored. Drawers save on their button.
11
Confirm irreversibles in their own dialogsm 400, object and count in the title, consequence in the body, the verb on the strong button, Cancel focused. Type to confirm for the very large.
12
Stack once, dim onceOnly a confirmation over its own dialog, smaller; the scrim moves up. Popovers in the top layer, toasts at 1300 outside. Drawers replace, with Back.
13
Move it honestlyDialog base in, fast out, scale .96. Drawer slow in, base out, its full width. Scrim linear. No width or height. Distance 0 under reduced motion.
14
Reduce for the phoneAt 640 and under: md and lg become bottom sheets, drawers become pages with Back, sm stays a dialog.
15
Check both modesOpaque everywhere. Dark dialog #2f2f2f with a brighter top edge, drawer hairline white .14, scrim black .60. Measure the page's ink under the scrim.

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.