Modal

A full-focus overlay window for critical information, forms, or workflows that need undivided attention. Built on the native <dialog> element, so focus trapping, top-layer rendering, and focus restoration come for free.

Install

Examples

With actions

Slot footer buttons into actions; the footer hides itself when empty.

Open modal

Modal body content goes here. Background content is inert while the modal is open, and focus is trapped within it.

Cancel Confirm

Slotted — radio group

Open modal
Free Starter Pro Team Enterprise
Cancel Confirm

Slotted — login form

Flags empty required fields and only closes when valid.

Open modal
Continue with Google
or
Sign in

Slotted — date picker

Open modal Cancel Confirm

Single action

Open modal

This action cannot be undone.

Got it

Body only

With no actions slot, the footer is hidden.

Open modal

A modal with no footer actions — dismiss with the close button, Escape, or a backdrop click.

Non-dismissable

no-dismiss disables Escape and backdrop clicks — the user must choose an action.

Open modal

Escape and backdrop clicks are disabled — you must choose an action.

Acknowledge

Guidelines

Usage

confirmations, focused tasks, and short forms that must interrupt the current flow. Call show() to open and close() to dismiss — Escape and backdrop clicks also dismiss unless no-dismiss is set.

Do

  • Reserve modals for tasks that genuinely must interrupt the flow.
  • Give a clear heading and put the primary action last.
  • Keep content short; for long flows use a dedicated page instead.

Don’t

  • Don’t stack modals on modals — finish one before opening another.
  • Don’t use no-dismiss unless an action is truly required.
  • Don’t bury critical info in a modal the user will reflexively dismiss.

Accessibility

Properties

Related