Switch to Wilmington
Overview

Modal

The modal pattern allows users to review or take action on information without navigating out of the main task flow. Because the container usurps control of the entire window, modals should only be used for information that requires the user's exclusive attention.

The required elements are the "Close" action, the modal title and body content, which is variable based on the purpose of the modal. Add a modal description to briefly summarize the body content when necessary. A divider may be used to separate the description from body content. The persistent action group allows the user to respond to the modal with actions other than "close."

Variants

Screenshot of standard modal component.
Standard
Use this modal in most cases where you need to show the user information or present actions without navigating away from the task flow.
Screenshot of confirmation modal component.
Confirmation

Use the confirmation modal to force a user decision before continuing an irrevocable action, such as canceling a transfer or a session timeout. If warning feedback does not require user confirmation, use the warning notification instead.

NOTE: This variant is not yet coded. Please check back at a later time.

States

Screenshot of modal component.

Default
The default state signals that the body content is in the top scroll position, or that there is nothing to scroll.
Screenshot of modal component.
On-Scroll
Modals with lengthy body content will change from the default state to the on-scroll state when the user begins to scroll. The shadowed header container showing the modal title appears as the modal content scrolls.

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

Modals can be dismissed in tablet and desktop environments by clicking outside of the container, in the area covered by a transparent gray fill. Modals take over the entire screen in mobile environments, so they can only be dismissed with the "Close" action. At larger breakpoints, modals take up 70% of the screen width, with a max-width of 710px. Omit the persistent action group from this pattern if "close" is the only available action. Do not duplicate with a "Close" button. Modals should never trigger other modals.

Microcopy

The standard modal description should be as brief as possible, ideally one or two sentences. Try to keep text content in the body concise to avoid scrolling if possible. Otherwise, follow guidelines for the title and button components.

The confirmation modal follows very strict microcopy patterns. The title will always be a question tied back to the action that triggered the modal, e.g. "Delete this payee?" after clicking Cancel. The body will give further context about the consequences of the action, e.g. "You are about to delete the payee National Fuel (...6789). All scheduled payments will be canceled. This action cannot be undone." Buttons are always yes/no with specific actions, e.g. "Yes, Delete" and "No, Cancel".