Modal

Also called dialog, modal window, or popup

A window that opens over the page, dims everything behind it, and blocks the rest of the interface until you finish or dismiss it.

What is Modal?

A modal appears in the middle of the screen on top of a dimmed backdrop. While it is open, nothing behind it responds, so people have to deal with it first: confirm, fill in a short form, or close it.

Use a modal when an action needs a decision before anything else happens, such as confirming a delete, or for a short, focused task like renaming a file. Longer forms and content people want to read alongside the page fit better in a drawer or on their own page, and a quick setting tied to one button fits in a popover.

A good modal moves keyboard focus inside when it opens, keeps Tab cycling within it, closes on Escape, and returns focus to the button that opened it. Label its buttons with the action itself, like Delete or Save changes. The native <dialog> element opened with showModal() gives you the backdrop, the Escape key, and an inert page behind it for free.

Often confused with

Drawer
A drawer slides in from an edge and suits longer content such as filters or details. A modal sits in the center for a short, focused decision.
Popover
A popover is anchored to the button that opened it and leaves the page usable. A modal blocks the page until you respond.
All terms

Drawer

A panel that slides in from the edge of the screen, usually the bottom on phones or the side on desktop, to show extra content or options.

Popover

A small floating panel anchored to the button that opened it, often with an arrow, holding a few controls and closing when you click outside.

Focus ring

An outline that marks which element has keyboard focus, so people moving through a page with the Tab key can see where they are.

Scale in

An entrance animation where an element grows from slightly smaller than its final size to full size while it fades in.