Modal
A dialog that holds one decision, then returns people to the page. Three widths: 460, 640, and 900.
Modal Title
Content area
CancelDone
- Header
- Title at 16 Medium and a close control. The title names the decision.
- Content
- Body of the modal with 24px padding. Holds the consequence, a short form, or supporting copy.
- Controls
- Cancel link on the left. Primary action on the right with a minimum width of 120px.
Playground
Variants and states
| Property | Options | Notes |
|---|---|---|
| size | 460, 640, 900 | Width of the modal surface. Size 640 is also 640px tall (or viewport minus 2rem) so the body can scroll. |
| header | title + close | 16 Medium title. Close dismisses and returns focus. Does not scroll. |
| content | body | 24px padding. Scrolls inside DialogBody when content exceeds the modal max-height. Header and footer stay fixed. |
| controls | cancel + primary | Cancel link on the left. Primary (or destructive) button on the right, min-width 120px. Does not scroll. |
Anatomy
- Header
- Title (16 Medium) and the close control. Names the decision.
- Content
- The body of the modal. 24px padding. Scrolls when the copy or form is tall.
- Controls
- Cancel link on the left. Primary action button on the right, at least 120px wide.
Accessibility
- Focus is trapped while the dialog is open.
- Escape and the close button dismiss it.