Modal

A modal or dialog is a large UI element that will appear on top of the main window with a transparency layer in between. This component is used to communicate specific information to users or ask them to take a specific action.

Anatomy

Anatomy callouts for the modal component
  1. Brand icon emphasizes the type of message in the modal (e.g., success, warning, error). It is optional.
  2. Close icon button allows the user to close the modal and cancel any actions made in the modal.
  3. Modal title sets the topic for the modal. It has a character limit.
  4. Body gives more context and communicates the status, consequences, or progress of an action. It has a character limit.
  5. Primary button allows the user to acknowledge the message.
  6. Secondary button allows the user to make a decision and take an action related to the message. It is optional for the general modal.
  7. Tertiary button allows the user to manage cookies. It is only present in the cookies modal.

Usage

When to Use

Use a modal when the user’s attention needs to be directed toward an important message or the user needs to make a decision towards executing an action.


More specifically, use them:

  • For important warnings to prevent critical errors.
  • To request information to continue a current process.
  • To request or confirm an action to continue a current process.
  • To break up a complex workflow into simpler steps.

When not to use

Don’t use a modal and a separate page or a snack-bar (notification) when:

  • The information is not important and not related to the current page or flow.
  • Complex content is difficult to follow and understand inside a modal.
  • The amount of content makes the modal a scrollable component (long scroll).
  • The user is making a complex decision and need detailed context and additional resources that are not present in the modal.

Variants

There are two main variations for the modal: with symbol and without a symbol. Both can have one or two CTAs and have the light or dark theme.

Modal variant 1 without a symbol
Modal variant 2 with a symbol
Specific example variant of the cookies modal
Variation
Purpose
Icon
CTA

General modal

Use to communicate an important message to the user and have their acknowledgment.

No icon

With CTA: a primary; a primary, and a secondary

General modal with icon

Use to communicate an important message to the user and have their acknowledgment, emphasizing and giving extra context on the message type with a brand icon.

With icon

With CTA: a primary; a primary; and a secondary

Cookies modal

Use to communicate a message related to cookies, giving the user the chance to decide to accept all or only necessary cookies, as well as to manage them.

No icon

With CTA: a primary; a primary and a secondary; a primary, a secondary, and a tertiary

Types

General Modal

Use only the primary CTA or the primary and secondary CTAs. No brand icon.

General modal with primary and secondary ctas

General Modal with Icon

Use brand icons and only the primary CTA or the primary and secondary CTAs.

General modal with icon showing primary and secondary CTAs

Cookies Modal

Use to communicate the cookies policy of the site. Use the primary button for the “Accept All” action, the secondary button for the “Allow Only Necessary” action, and the tertiary button for the “Manage Cookies” action.

Cookie modal used to communicate the site cookie policy

Container

Maintain consistent behavior and standard spacing and sizing between the elements that compose a modal.

Spacing

Ensure that proper space is given between each modal item.

Spacing of elements within the general modal
General modal
Spacing of elements within the general modal with icon
General modal with icon
Spacing around elements within the cookie modal
Cookies modal

Hierarchy

A proper hierarchy must be ensured for the elements that compose the modal. The CTAs of the general modals should be a primary and secondary button at the bottom (secondary button is optional). A brand icon can be used depending on the type of message, placed on top to support or give more context to the textual content. The title, with the highest level of importance, needs to give a clear and short idea of the topic of the modal content.


For the cookies modal, the CTAs should be at the right side of the body text, left-aligned to the modal container; there should be a primary, secondary, and a tertiary button.

Alignment

The alignment of components within the modal depends on the variant. For the general modals (with and without icons), the text, CTAs, and icon are left-aligned.

Alignment between text and CTAs for general modal
Alignment between text and CTAs for general modal with icon

For the cookies modal the text is left-aligned and the CTAs is right-aligned.

Alignment between CTAs and text within the cookie modal

Behavior

Overlay

Modals will pop up over the page where prompted over an overlay in Neutral 15 with a transparency of 50% for light theme, and Neutral 60 with a transparency of 50% for dark theme.

Light theme overlay behavior for modals
Overlay for light theme
Overlay behavior for dark theme modals
Overlay for dark theme

Sizing

The general modal will manage one maximum width for each viewport. The cookies modal will manage two sizes.

Maximum width for the modal on each breakpoint (XL, LG, MD, SM).
General modal
What the modal component looks like at the larger viewports
Cookies modal: XL and LG viewport

In the case of the cookies modal, the modal becomes a single column of stacked content in the medium and small viewports; the CTAs adjust below the text block.

What the modal component looks like at the medium viewport
Cookies modal: MD viewport
What the modal component looks like at the small viewport
SM viewport

Themes

General Modal (With and Without Icon)

General modal on dark theme
Dark
General modal on mid theme
Mid
General modal on light theme
Light

Cookies Modal

Cookies modal on dark theme
Dark
Cookies modal on mid theme
Mid
Cookies modal on light theme
Light