---
title: Examples
slug: wip/MzEw-examples
createdAt: 2025-10-02T15:19:53.208Z
---

# Examples

Modal Dialogs capture full attention to isolate a task, decision, or information display while preserving page context.  Because they interrupt flow and block interaction, use them sparingly with concise, purposeful content.

## Basic Usage

The modal dialog is a focused container that interrupts the current flow to present information or require input, structured into three optional slots: a **header&#x20;**&#x74;o establish context, a **body&#x20;**&#x66;or the main content, and an **actions&#x20;**&#x63;ontainer for task-specific controls.

:::Iframe{iframeHeight="0" code="<iframe&#xA;  height=&#x22;500px&#x22;&#xA;  loading=&#x22;lazy&#x22;&#xA;  src=&#x22;https://cosmos-storybook.rbds-production.redbullaws.com/storybook/iframe.html?globals=&args=&id=guidance-modal-dialog--basic-usage&viewMode=docs&#x22;&#xA;  title=&#x22;Embeded content from Storybook&#x22;&#xA;></iframe>"}

:::

***

## Body Overflow

Body height adapts to content with a max-height of **100vh (minus customizable insets)** that reduces to **95vh** below the 650px breakpoint.

When the content exceeds this limit, the body becomes **scrollable**. If an actions container is present in this state, a divider is automatically rendered between the body and the actions container to maintain clear separation.

:::Iframe{iframeHeight="0" code="<iframe&#xA;  height=&#x22;500px&#x22;&#xA;  loading=&#x22;lazy&#x22;&#xA;  src=&#x22;https://cosmos-storybook.rbds-production.redbullaws.com/storybook/iframe.html?globals=&args=&id=guidance-modal-dialog--body-overflow&viewMode=story&#x22;&#xA;  title=&#x22;Embeded content from Storybook&#x22;&#xA;></iframe>"}

:::

***

## Size Options

The modal offers four predefined size options: **small (400px)**, **medium (560px)**, **large (720px)**, and **x-large (100vw minus inset)**.

All modal sizes adapt to the viewport width, constrained by an inset (customizable), ensuring the dialog maintains spacing from screen edges.

:::Iframe{iframeHeight="0" code="<iframe&#xA;  height=&#x22;500px&#x22;&#xA;  loading=&#x22;lazy&#x22;&#xA;  src=&#x22;https://cosmos-storybook.rbds-production.redbullaws.com/storybook/iframe.html?globals=&args=&id=guidance-modal-dialog--size-options&viewMode=story&#x22;&#xA;  title=&#x22;Embeded content from Storybook&#x22;&#xA;></iframe>"}

:::

***

## Responsive Behavior

For viewports **≥650px**, the component renders as a centered dialog modal. For viewports **\<650px**, it renders as a bottom sheet. In bottom sheet mode, the component spans **100% of the viewport width&#x20;**&#x77;ith a maximum width **constraint of 560px.**

:::Iframe{iframeHeight="0" code="<iframe&#xA;  data-no-resize&#xA;  height=&#x22;1000px&#x22;&#xA;  loading=&#x22;eager&#x22;&#xA;  src=&#x22;https://cosmos-storybook.rbds-production.redbullaws.com/storybook/iframe.html?globals=&args=&id=guidance-modal-dialog--responsive-behavior&viewMode=story&#x22;&#xA;  title=&#x22;Embeded content from Storybook&#x22;&#xA;></iframe>"}

:::

***

## Critical Dialogs

When `dismissible` is set to `false` the modal dialog cannot be closed without user action. It renders no close button or drag handle, ignores scrim clicks, and blocks the Escape key, forcing resolution **through explicit actions only**.

:::Iframe{iframeHeight="0" code="<iframe&#xA;  height=&#x22;500px&#x22;&#xA;  loading=&#x22;lazy&#x22;&#xA;  src=&#x22;https://cosmos-storybook.rbds-production.redbullaws.com/storybook/iframe.html?globals=&args=&id=guidance-modal-dialog--critical-dialogs&viewMode=story&#x22;&#xA;  title=&#x22;Embeded content from Storybook&#x22;&#xA;></iframe>"}

:::

***

## Appearance

By default, the Modal Dialog inherits the light mode environment and appears in `light` styling. Its appearance can be explicitly set to `dark` if required.

:::Iframe{iframeHeight="0" code="<iframe&#xA;  height=&#x22;500px&#x22;&#xA;  loading=&#x22;lazy&#x22;&#xA;  src=&#x22;https://cosmos-storybook.rbds-production.redbullaws.com/storybook/iframe.html?globals=&args=&id=guidance-modal-dialog--appearance&viewMode=story&#x22;&#xA;  title=&#x22;Embeded content from Storybook&#x22;&#xA;></iframe>"}

:::

