v1.2.0

Dialog

Dialogs inform users about a task and can contain critical information, require decisions, or involve multiple tasks. They appear on top of the page content.

Basic Dialog

Open Dialog
Dialog Title

This is the dialog content. It can contain text, forms, or any other elements.

Cancel Confirm
<me-dialog id="dialog"> <me-dialog-title>Dialog Title</me-dialog-title> <me-dialog-content> Dialog content goes here. </me-dialog-content> <me-dialog-actions> <me-button variant="text">Cancel</me-button> <me-button color="primary">Confirm</me-button> </me-dialog-actions> </me-dialog> <script> document.querySelector('#open-btn').addEventListener('click', () => { document.querySelector('#dialog').setAttribute('open', ''); }); document.querySelector('#dialog').addEventListener('me-close', () => { document.querySelector('#dialog').removeAttribute('open'); }); </script>

Max Width Variants

xs (444px) sm (600px) md (960px)
Extra Small Dialog

This dialog has max-width="xs" (444px).

Close
Small Dialog

This dialog has max-width="sm" (600px).

Close
Medium Dialog

This dialog has max-width="md" (960px).

Close

Full Width

Full Width Dialog
Full Width

This dialog stretches to fill its max-width container.

Close

With Dividers

Dialog with Dividers
Scrollable Content

When content might scroll, use dividers on the content area to visually separate it from the title and actions.

This border helps users see that there is more content above or below when they scroll.

OK

API — me-dialog

AttributeTypeDefaultDescription
openbooleanfalseWhether the dialog is visible.
max-widthxs | sm | md | lg | xlsmMaximum dialog width.
full-widthbooleanfalseStretch to fill max-width.
full-screenbooleanfalseFull-screen overlay (mobile).

Events

EventDetailDescription
me-close{ reason: 'backdropClick' | 'escapeKeyDown' }Fired when the backdrop is clicked or Escape is pressed.

Sub-components

ElementAttributesDescription
me-dialog-titleDialog heading (1.25rem, 500 weight).
me-dialog-contentdividersScrollable body area. Add dividers for top/bottom borders.
me-dialog-actionsdisable-spacingAction button row. Add disable-spacing to remove padding/gap.