Containers · 6 parts · 3 states · Advanced

Modal / Dialog

Interrupts the page to ask for attention or input, and blocks everything behind it.

01Anatomy

Delete project?
The project and its 12 files will be removed. You can’t undo this.
CancelDelete

6 parts. Select a number or a name to see what each part does.

01 · Backdrop

Dims the page behind it. It says: the rest isn’t available now.

Required
Yes
Recommended
Clicking it often closes non critical dialogs. Varies by design system.

02 · Surface

The panel that holds the dialog, above everything else.

Required
Yes

03 · Title

Says what the dialog is about. It is also its accessible name.

Required
Yes
Recommended
A question for a decision: “Delete project?”

04 · Close button

Dismisses without acting.

Required
No
When
Often left out when an answer is mandatory.

05 · Content

Explains the situation and the consequences, or holds a short form.

Required
Yes

06 · Actions

The choices: the main action plus a way out. The order varies by platform.

Required
Yes
Recommended
Name the action on the button: “Delete”, not “OK”.

02Structure

  • Modalcomponent set
  • Backdroprectangleblack 60%
  • Dialogauto layoutverticalfixed 320hugpadding 24gap 16
  • Headerauto layouthorizontal
  • Titletextfill
  • CloseinstanceIcon Buttonboolean
  • Bodyslot or text
  • Footerauto layouthorizontalgap 8
  • SecondaryinstanceButton
  • PrimaryinstanceButton
Structure
PropertyTypeValues
TypeVariantDefaultAlertForm
SizeVariantSmallMediumLargeFull screen
CloseBooleantruefalse
FooterBooleantruefalse
BodySlot or Instance swapa content component

Keep the backdrop outside the Dialog component, so the dialog can also be placed on any frame.

03States

OpenFocus is inside and the page behind is inert.
Initial focusOn open, focus goes to the first useful element. For destructive choices, often the safe one.
Long contentThe content scrolls; title and actions stay visible.

When it closes, focus goes back to the element that opened it.

04Variants

Alert dialogAsks to confirm something important and waits for an answer.
Form dialogA short task, like renaming.
Full screenCommon on phones for longer tasks.
Non-modalNo backdrop and the page stays usable. Not a modal anymore.

05Responsive behaviour

Desktop

Centred, with a max width of about 480 to 640 px.

Mobile

Full screen or a sheet from the bottom. Actions stack or take the full width.

There is no single correct anatomy: names, variants and properties differ from one design system to another. These are common structural models distilled from established design systems and accessibility guidance.

Fuori Frame

Proven methods for designing interfaces with AI. Every two weeks, in Italian.

Subscribe