Modals

A modal is a dialog that takes the page away from the reader: it lays a scrim over everything behind it, puts one decision in front of them, and stays until they answer. The four here are the four things a dialog is normally raised to say, something failed, something is about to be destroyed, something finished, something is worth knowing.

Alignment carries the difference. The two that ask for a decision set the icon beside the text, because the reader's eye should land on the title and the buttons; the two that only announce centre the tile over the words, because there is nothing to weigh. The don't-show-again checkbox is a promise, not decoration, if the choice isn't stored somewhere the reader's next session can see, the dialog is lying to them. And a modal that opens over another modal is a design that has run out of room: flatten it into steps in one dialog, or give the second thing a page.

6 blocks

Error Modal

A problem the reader has to acknowledge before carrying on

Warning Modal

Destructive actions that need a deliberate confirmation

Success Modal

Confirming something finished, with the icon over the words

Information Modal

Announcements the reader only has to read

Status modal, morph

Confirmations that should feel tied to the button that asked for them

Status modal, stakes

Decisions that should be made from the facts, and destructive ones that need a deliberate press

01

Using Modals

Reach for it when

  • A destructive action you want someone to confirm deliberately
  • An error that has to be acknowledged before the app can carry on
  • A short form that would lose the reader's place if it took over the page
  • Announcing a change that has already happened behind the scrim

Reach for something else when

  • Anything the reader does not have to answer: a toast says it and leaves
  • Long or multi-section forms: give them a page or a side panel so the work can be saved
  • Prompts fired on load before anyone has done anything: put that inline or in a banner
02

Where it shows up

01

Destructive confirmations

Deleting a component other screens still place, or removing a member with work assigned. The dialog's job is to name the consequence in its description, not to ask a generic are-you-sure.

02

Limit and billing blocks

A workspace over its seat count, an upload past its size, a plan that has to change before the action can finish. The reader cannot carry on, so a dialog is the right place to say so.

03

Release announcements

A library version published, a feature turned on for everyone. Centred, read-only, one button to dismiss, and a checkbox so the person who has seen it does not see it every session.

04

Maintenance notices

Scheduled downtime that turns editing read-only. A dialog is right when the notice lands mid-session and changes what the person can do next; if it can wait, a banner carries it instead.

03

Questions

What accessibility does a modal dialog need?

The dialog needs a dialog role and an accessible name from its title, focus moved into it when it opens, focus kept inside while it is open, and focus returned to whatever opened it when it closes. Escape must dismiss anything that is not a blocking error. Content behind the scrim should be inert so a screen reader does not wander into it.

Can a modal open another modal?

All blocks
The Orvain Dispatch

Premium components, free in your inbox.

Join the Orvain Dispatch and get production-ready components, free to keep: React and Vue code plus the Figma frame, yours to ship.

Just components, never spam. You can unsubscribe anytime.