Switch to M&T
Overview

Modal

Modals present contextual information or tasks without navigating the user away from the main task flow. Because they sit on an elevated layer and disable the layout behind them, they should be used for tasks and alerts that require the user's exclusive attention.

Variants

Standard Modal

Screenshot of modal component.

Standard modals constitue a continuation of a user's task flow and are the most used modal type. They allow the user to review information or take action.

The required parts are a title, body content and associated actions. Body content in a modal may be plain text or contain interactive elements. Optionally, a standard modal may have a sub-header and a Close icon to dismiss the modal and return to the underlying screen.

Alert Modal

Alert modals interrupt or end a user's task flow to give critical feedback about the action they're trying to take or force an immediate action. The required elements are a feedback icon, a title, body content and a way to dismiss the modal. Alert modals have no associated states.

Screenshot of info alert modal component.
Information Alert Modal
Use information alert modals to direct the user on how to continue an interaction outside of the designed experience.
Screenshot of warning alert modal component.
Warning Alert Modal

Use warning alert modals to warn of destructive action and ask for immediate user confirmation in instances where the action will lead to data loss. If warning feedback does not require user confirmation, use the Notifcation component instead.

Screenshot of warning alert modal component.
Error Alert Modal

Use error alert modals to tell the user of an error that they cannot resolve on their own. Provide information within the body on how to proceed. If warning feedback is related to an action on the underlying page and can be fixed there, use the Notifcation or Inline Error components instead. To communicate a system error, use a full-page error layout.


States

Screenshot of modal component.
Scroll
In addition to the default state, which indicates that a modal is in the top scroll position or there is no scrollable content, Standard Modals with lengthy body content can use a scroll state. When scrolling, the header and optional sub-header, as well as the footer bar, will elevate and remain persistent at the top of the container with the rest of the content scrolling behind.

Accessibility

Modals trap keyboard focus. Users must dismiss the modal, when possible, in order to return to the underlying page. Do not put information in a modal that necessitates the user interacting with information on the layout below. When the modal closes, focus should move back to the layout element that triggered it.


Design Environment

At larger breakpoints, modals take up 70% of the screen width, with a max-width of 710px. Modals can be dismissed in many ways: by clicking the scrim outside of the modal container, pressing the escape key, clicking the close icon or any dismissing action included in the modal. Modals should never trigger other modals.


Mircocopy

Modal titles should be concise and use key words to communicate a clear message. CTA text should be action driven and relate to the Modal title. Omit a CTA if the only available action is closing the modal. Instead, rely on the close icon.