Modals

Modals appear over other content to inform users or ask them for a decision.

Figma logo The guideline content on this page is synced with Figma and can be used as a source of truth. Open in Figma


Anatomy

  1. Header title
  2. Divider
  3. Icon (optional)
  4. Close button
  5. Container
  6. Footer
Modal anatomy diagram showing: 1 — header title, 2 — divider, 3 — icon, 4 — close button, 5 — container, 6 — footer

Sizes

We have two different sizes for a modal — small and large — to ensure usability and flexibility.

Small

A small modal is used for simple, focused tasks that require minimal information. It’s ideal for actions that need a quick user decision, like confirming a deletion, giving a simple warning, or capturing a very short amount of information.

The small size keeps the user’s attention on the primary task without distracting them with the main page’s content, making the interaction fast and efficient.

Large

A large modal is used for more complex tasks that require more screen real estate. This includes detailed forms, multi-step wizards, or displaying a significant amount of information, like an image gallery or a document preview.

The larger size provides enough space for all the necessary content without forcing the user to scroll excessively. It keeps the user within the context of the main application whilst still providing a focused, task-oriented view.


The modal backdrop (or overlay) is the layer of semi-transparent colour that covers the rest of the application interface when a modal window is open. Its primary purpose is to direct the user’s focus solely to the content within the modal, visually indicating that the background content is temporarily inactive or blocked.

To ensure consistency and clear visual hierarchy, the modal backdrop uses a specific colour variable and opacity settings. This is the same colour for all places using this functionality (drawer etc).

  • Colour variable: surface/strong
  • Opacity: 25% (or 0.25)
Modal with backdrop overlay showing a semi-transparent layer behind the modal

Slot component

Slot components are designed to be as flexible as possible. Here you can place a variety of content.

The container adjusts to the content of the modal.


Variants

The modal component is available in several variants to support different types of messages and user interactions.

Basic information

Used for general information or actions that do not require a specific status or level of urgency.

Alert

Used to communicate status messages or situations that require the user’s attention. The alert type reflects the meaning of the message.

  1. Info: Communicates neutral information.
  2. Help: Provides guidance or support to help the user complete a task.
  3. Warning: Indicates a potentially risky action or situation.
  4. Error: Indicates that something went wrong or an action failed.
  5. Success: Confirms that an action was completed successfully.

Buttons

In a design system, placing the primary button on the right side of a modal is a key practice for user experience and usability.

This placement aligns with common reading patterns and user expectations, making the modal’s primary action easier to find and click.


Accessibility

Keyboard interaction

All components should be reachable via TAB and SHIFT+TAB keys.


Best practices

Button alignment

Do

Always align buttons to the right in the footer.

When you have more than one button, place the primary button to the right of the secondary button.

Don't

Don’t place buttons to the left or middle of the footer.

Don’t put primary buttons to the left of the secondary or tertiary buttons.


Specs

Modal specification measurements

Developer reference

The following sections describe supported functionality that is not part of the Figma design specification.


Design

A rendered modal with header, body, and a set of actions in the footer.

A dialog box (default) has a fixed width of 520px, but it shrinks when there is not enough space for it. More sizes are available below.

Also, you can arrange the buttons from a modal using helper classes.


Options

Modals with alert icons

By adding .modal-info, .modal-help, .modal-success, .modal-warning or .modal-error class to the modal wrapper .modal, it will transform the modal into an alert dialogue.

By default the icon will be placed on the left, but you have the option to place it on top and align everything on centre (.modal-center). Follow the examples below. Note: The centred icon placement (.modal-center) is deprecated from 2.4 and will be removed in 3.0.

Default — icon placed on left

Centred — icon placed on centre

Deprecated 2.4 — This feature will be removed in 3.0.

Modals support 6 sizes (5 modifiers + the default):

  • full width (.modal-full)
  • extra large (.modal-xl)
  • 900px (.modal-lg) — for complex tasks, detailed forms, or document previews
  • 520px (default size, or .modal-sm) — for simple, focused tasks
  • 480px (.modal-xs)

Classes need to be placed on .modal-dialog.

By clicking on buttons the modal will show; the functionality is just an example on how it should work.

For this component you need JavaScript! We recommend you to create your own script to show and hide the modal. If you need help just contact us.