Skip to content

Modal

Modals are overlay dialogs that appear on top of the main content to display important information, collect user input, or confirm actions. They temporarily block interaction with the underlying page until dismissed.

Loading Code Block...

A default modal with header, description, scrollable body content, and action buttons.

Loading Code Block...

The modal supports two types:

TypeDescription
defaultFlexible container with custom content slot, header, description, and action buttons
alertCentered confirmation/notification with state icon, message, and stretch-layout buttons
Loading Code Block...
SizeWidth
sm520px
md605px
lg720px

Use the dropdown in the interactive demo below to toggle between sm, md, and lg — the code snippet updates to match.

Loading Code Block...

Alert modals support three visual states, each with a corresponding coloured icon:

StateIconColour
successCheck markGreen (theme-icon-accent-primary)
warningExclamation markYellow (theme-icon-warning)
destructiveClose / XRed (theme-icon-danger)

When state is destructive and type is alert, the primary button automatically receives destructive: true styling.

Loading Code Block...

Default modals support a built-in progress bar at the top, useful for multi-step wizards and onboarding flows. The bar is rendered when showProgress is true and is sized from currentStep / totalSteps (or from progressValue when provided directly).

Loading Code Block...

When staticBackdrop is true, clicking outside the modal does not close it. Users must interact with a button or the close icon to dismiss.

Loading Code Block...

  • The dialog container exposes role="dialog" and aria-modal="true" in both frameworks (React via Radix’s Dialog.Content; Vue via the native <dialog> element)
  • React (Radix) traps focus inside the dialog — Tab cycles through interactive elements inside the modal and never escapes to the page underneath. Vue currently focuses the first focusable on open and restores focus to the previously active element on close, but does not intercept Tab — keyboard users can tab past the last focusable inside the modal into the page below
  • Pressing Escape closes the modal in both frameworks (unless staticBackdrop is true)
  • Vue wires aria-labelledby / aria-describedby to the rendered headerText / subtext IDs when those props are present
  • The close button has aria-label="Close modal" for screen readers
  • Body scroll is locked when the modal is open (overflow: hidden in Vue; equivalent body scroll lock applied by Radix in React)