Dialog

v4.0.0

Dialogs appear in front of other content to ask for a decision or inform users of important information.

Stylized graphic of a set of dialogs.

Considerations

Focused

Dialogs focus the user on a single task or piece of critical information.

Responsive

Dialogs are initiated by the user either explicitly or implicitly. They are not system-generated.

Intentional

Dialog content is necessary and helpful for the user to complete a larger goal.

Anatomy

Number 1 points to the scrim. Number 2 points to the header container. Number 3 points to the content container. Number 4 points to the footer container.
  1. Scrim
  2. Header
  3. Container
  4. Footer

Properties

Container

Dialog containers are designed to be flexible to account for a wide variety of content types. The container adjusts to fit its content up to its maximum height.

Dialog with a title of “Make an offer”, an empty content container, and a footer with two buttons.

Header

A header is required and provides two layout options: standard and image. The image variant moves the title downwards and increases the overall padding of the dialog. Use the image header for expressive messaging.

Dialogs with different header container layouts. The left dialog shows a header container with an image and title below the image. The right dialog shows a simple header with a title.

Width

There are 3 sizes available for dialogs: narrow (480px), regular (616px), and wide (896px). The maximum width of dialogs is 100% of the grid width.

3 dialog container examples overlayed over each other showing the 3 width available of narrow, regular, and wide.

Type

There are three types of dialogs available depending on the type of decision and number of actions present.

Alert dialog with a single buttons.

Alert

Alert dialogs require the user’s attention. They are usually presented by the system, not an explicit user action, so they are highly disruptive. Alerts have a single action and can only be dismissed through the action.

Confirm dialog with two buttons.

Confirm

Confirm dialogs inform users of a decision’s impact. These dialogs present two actions and are dismissed by interacting with one of them.

Task dialog with two buttons in the footer container and a radio button group to select a payment method in the content container.

Task

Task dialogs request users to complete a focused task or provide more information related to an element on the main page. The content can vary depending on use case, like form fields to update an item in a table or additional information about a program. Task dialogs have a close button in the header to allow users to dismiss the dialog at any time without a decision.

Behavior

Height

A dialog’s height defaults to fit its content. The maximum height of a dialog is 90% of the screen height and the minimum height is 280px.

Two simple dialog containers, one on top of the other, showing the flexibility of containers between minimum height and maximum height.

Scrim

The scrim blocks interactions with the main page to focus the user on the task or message within the dialog. All dialogs are modal, so the scrim is automatically applied. Learn more about scrim tokens.

Use a popover for situations that don’t require modality.

Dialog over a scrim that darkens and separates the dialog from the elements behind it.

Button overflow

Dialogs with buttons in the footer stack vertically when the footer is too narrow for the button titles.

A dialog with three buttons in the footer that are stacking vertically to preserve the title lenght.

Screen sizes

Small screen native

Native applications use the bottom sheet for dialogs.

Full screen overlay on a compact iOS device with an illustration image, title, description, and button.

iOS form sheet

Full screen overlay on a compact Android device with an illustration image, title, description, and button.

Android full screen overlay

Small screen web

Dialogs on web are inset and bottom-aligned.

Lightbox dialog in a web browser on a small screen. The dialog is anchored towards the bottom and inset from the sides and bottom of the screen.

Web bottom inset sheet

Full screen overlay in a browser on a small screen with an illustration image, title, description, and button.

Web full screen overlay

Large screen

Dialogs are centered on larger screens across platforms. Dialogs can be offset to the left or right on large-format foldable devices.

A centered dialog on a large screen device.

Centered sheet dialog

An offset dialog on an open foldable device.

Offset sheet dialog on foldable device

Best practices

Alignment

Do always center-align alert and confirm dialogs.

A dialog footer with a tertiary “cancel” and primary “Create coupon” buttons.

Don’t bottom-align alert and confirm dialogs.

A dialog footer with a tertiary “No” and primary “Yes” buttons.

Complexity

Focus the content on a single subtask with simple interactions and decisions.

A dialog with complex filters, checkboxes, and links, along with a paginated footer.

Avoid overloading modals with complex interactions and decisions. This can overwhelm and confuse users. Use a new page if the content cannot be simplified.

A dialog with complex filters, checkboxes, and links, along with a paginated footer.

Nesting

Dialogs lie above all main page content.

A single dialog above all other page content.

Dialogs should not trigger other dialogs. This quickly becomes inaccessible and confusing. Links within modals should open in a new tab or dismiss the modal before navigating.

A dialog opening another dialog that is stacking on top of each other.

Size

Do keep dialog content focused and short and avoid scrolling behavior when possible.

A dialog above all other page content. The content is minimal and there is no scroll.

Consider using a page if the content extends far beyond the dialog container and includes complex interactions.

A long, complex dialog that contains a scroll.

Overflow

Content should only scroll vertically if it extends beyond the dialog window.

A dialog with a vertical scroll.

Avoid content that scrolls horizontally within a dialog.

A dialog with both a vertical scroll on the dialog content itself and a horizontal scroll on just a section of content.

Specs

A spec for a dialog container. The container has 16px of padding on all sides. The header area contains a title and a 32px close icon button with 16px of padding between it and the content area. A full-width divider line with 16px of padding above and below it sits below the content area, followed by a pair of CTA buttons that are anchored to the bottom right.

Task dialog

A spec for a confirm dialog container. The container has 16px of padding on all sides. 8px of padding is between the title and body copy. 16px of padding is between body copy and button group. 8px of padding is between the buttons.

Confirm dialog