Skip to main content

Modal

A modal is a surface that overlays the page’s main content and is used to display information, gather input or confirm actions.

[Android] Dialog

A Dialog is a pop-up window that prompts the user for interaction or information within an app interface.


Dos and Don’ts

Do
  • Use dialogs in the neutral-alternative variant to display critical information and display urgent messages.
  • Choose variants in brand colours for promotional and non-critical content.
  • Use dialogs to drive user input or prompt for decisions.
  • Use dialogs for confirmations for important actions.
  • Ensure all content meets AA accessibility standards and is read by assistive technologies.
Don't
  • Don't allow excessive content length. Modals are for focused tasks, check out the Overlay patterns documentation to see if another component might be more suitable.
  • Don't use dialogs for minor notifications.
  • Limit and avoid excessive interruptions.
  • Don’t add crucial information to images.

Anatomy

Anatomy of a Dialog.
  1. Header (optional): Adds content to the header. Choose from illustration, image or slot.
  2. Title: Concise heading for clarity.
  3. Body (Optional): Clear description to offer more information/context.
  4. Primary Button: Main action for user interaction. Variant overrides available.
  5. Ghost Button (Optional): Secondary action option. Variant overrides available.
  6. Container: Dialogs are in an elevated container.
  7. Footer content (Optional): Ability to add non interactive text below buttons.
  8. Header slot: Content which can be replaced with designed local components.
  9. Body slot (Optional): Content which can be replaced with designed local components.
  10. Footer slot (Optional): Content which can be replaced with designed local components.

Variants

Neutral - alternative

Neutral-alternative variation of the dialog.

02 Orange subtle

Orange subtle variation of the dialog.

03 Cupcake strong

Cupcake strong variation of the dialog.

03 Cupcake subtle

Cupcake subtle variation of the dialog.

04 Berry strong

Berry strong variation of the dialog.

04 Berry subtle

Berry subtle variation of the dialog.

05 Turmeric strong

Turmeric strong variation of the dialog.

05 Turmeric subtle

Turmeric subtle variation of the dialog.

06 Aubergine strong

Aubergine strong variation of the dialog.

06 Aubergine subtle

Aubergine subtle variation of the dialog.

08 Latte strong

Latte strong variation of the dialog.

08 Latte subtle

Latte subtle variation of the dialog.

Usage

Colour

For critical messaging, the Neutral - alternative variant must be used. For non-critical messaging (offers/vouchers/promotions), the variants with coloured backgrounds can be used.

Critical messaging

Dialog in variant neutral-alternative for critical messaging.

Promotional messaging

Dialog in variant cupcake subtle for promotional messaging.

Alignment

Critical messaging should always be left-aligned. Promotional messaging can be center-aligned.

Critical messaging

Dialog with text left-aligned for critical messaging.

Promotional messaging

Dialog with text center-aligned for promotional messaging.

Title prominence

Critical messaging should use default title styling. Promotional messaging can use prominent styling.

Critical messaging

Dialog with default title styling for critical messaging.

Promotional messaging

Dialog with prominent title styling for promotional messaging.

Sizes

The default width of the component is set to 328px, however may be adjusted to fit specific device, ensuring a 16px margin is applied from the edge of the screen.

Please note that the minimum width of the modal component is 288px.

Default

Dialog in default size with 328px width and 16px margin.

Minimum Size

Dialog in minimum size with 288px width.

Modifiers

Emphasis through colour

Depending on the level of visual prominence you want to give to the Modal, you can choose between strong or subtle emphasis.

Strong

Dialog with strong colour emphasis.

Subtle

Dialog with subtle colour emphasis.

Title

Depending on the level of visual prominence you want to give to the title, you can choose between default or prominent emphasis.

Default title

Dialog with default title styling using the typography token Heading M.

Prominent title

Dialog with prominent title styling using the typography token Heading XL italic.

Centre-alignment

You can use centre-alignment in a dialog to highlight short messages, like titles or brief instructions, enhancing readability and importance. However, longer text or multiple elements may benefit from left-aligned text for better flow.

Dialog with centre-aligned text.

Header content

Illustration

You can use an illustration in the header of a Dialog to add visual context, this can reinforce the modal's purpose and enhance engagement while aligning with the app's design.

Dialog with illustration in the header.

Image

You can use an image in the header of a Dialog to add visual context. This is available either with full bleed or with 16px margin either side.

Full bleed image
Dialog with full bleed image in the header.
Image with margin
Dialog with image in the header and margin.
Image size

There are 3 aspect ratios for imagery within the modal component. Aspect ratios are locked and will keep their height and width properties when resizing the component. There are 3 available sizes/ratios:

The image aspect ration must be consistent across portrait and landscape design as to not distort or stretch the image.

Small (3:1)

Dialog with small image in the header.

Medium (16:9)

Dialog with medium image in the header.

Large (4:3)

Dialog with large image in the header.

Animation

Animation can be used in the header of a Dialog to add visual context. Lottie files will need to be used for implementing this in development; however, GIF animations can be used in Figma files for visual purposes only.

Dialog with animation in the header.

Hidden decorative content in the header on landscape mode

On landscape mode the visual property can be disabled. This ensures users can easily view and scroll through content.

Dialog with hidden decorative content in the header on landscape mode.

No body

You can use a dialog with no body for quick confirmation messages, alerts, notifications or confirmation prompts where the title alone is enough.

Dialog with no body text.

Side by side calls to action

You can use side-by-side calls to action when space is limited or when both actions are equally important. This is often seen in confirmation prompts for efficient interaction, like "OK" and "Cancel".

Please note that this modifier is only available for left-aligned Dialogs..
Dialog with side-by-side calls to action.

Single call to action

You can use a single call to action in a dialog when there's only one primary action and to simplify user decisions. This is often seen in scenarios without alternative choices.

Dialog with single call to action.

Designers have the option to add non-interactive text below the actions, or they can use a slot to add in other content below the actions. This option will be hidden by default and will be enabled by toggle.

Dialog with footer text.
Dialog with footer slot.

Interactions

Closing the dialog

Tapping outside the dialog's boundaries will close it, providing an intuitive way to dismiss it without interacting with specific UI elements like calls to action (unless that is otherwise specified by the interaction).

This interaction is enabled by default. Designers need to ask engineers to disabled during in the handover.

Example of a dialog closing when tapping outside its boundaries.

Slots available

The purpose of chips is to provide a visual representation of a specific entity or attribute, such as a selected option or a labelled category. Chips can also be interactive, allowing users to remove or modify the selected choices. Chips are commonly used in various contexts, including filtering options, search results or any situation where concise and visually distinct information needs to be displayed.

  1. Header slot: Hidden by default.
  2. Body slot: Available as a variant.
  3. Footer slot: Hidden by default.

Content

Title content

Ensure the title clearly communicates the purpose or topic of the dialog. Keep the title brief and to the point, avoiding unnecessary wording. Make sure the title directly relates to the content of the dialog, helping users understand its significance. Maintain consistency in tone and style with the rest of the application's UI for a cohesive user experience. Titles have the ability to toggle on and off prominence:

  • Default (Heading M/Narrow)
  • Prominent (Heading XL/Narrow italic)

Body

Provide clear and concise information or instructions that help users understand the context or purpose of the dialog. Include only essential details relevant to the user's current task or decision-making process, avoiding unnecessary information.

Calls to action

Clearly label each call to action to indicate its purpose and the outcome of selecting it. Use verbs that prompt immediate action and clearly convey what will happen when the user selects the option. Use language that is familiar and understandable to the target audience, avoiding technical or industry-specific terms that may confuse users.

Use it for non-interactive, secondary information. This includes disclaimers, terms and conditions, legal text, and specific offer restrictions. Do not use it for primary actions or critical messaging. Content here must be purely supplementary and non-essential to completing the main task of the modal.


Overrides

Title overrides

Example of a dialog title using default heading being replaced with heading italic.
  1. Title: Title can be overridden to use any of the Heading font tokens. As a default state, the title will use Heading M / Narrow. When the prominent toggle is engaged, Heading XL / Narrow italic is applied.

Buttons overrides

Example pointing at dialog buttons that can be overridden to use different variants.
  1. Buttons: The Button’s size can be decreased, and their variant can be changed. But all changes must adhere to the button pair guidelines if they are kept as a pair, including the size of both buttons remaining consistent.

Examples

Here’s some examples of a Dialog in context:

LTR examples

Example of a dialog in LTR context.

RTL Examples

Example of a dialog in RTL context.
Back to top