Dragonglass

Dialogs

Centered dialogs with shape, width and elevation variants.

Dialog with actions

Review changes

Confirm the title and owner before publishing this project.
<dialog open class="static" aria-labelledby="review-dialog-title">
  <header>
    <h3 id="review-dialog-title">Review changes</h3>
    <nav aria-label="Dialog actions">
      <button type="button" data-button="fab" class="inline" aria-label="Share review">
        <i class="material-icons" aria-hidden="true">share</i>
      </button>
    </nav>
  </header>
  <section>
    Confirm the title and owner before publishing this project.
  </section>
  <footer>
    <nav aria-label="Review decision">
      <button type="button">Cancel</button>
      <button type="button" class="bg-primary">Publish</button>
    </nav>
  </footer>
</dialog>

Shape, width and elevation

Team event

May 24, 7:00 PM

Workspace settings

Settings use the available viewport width.

Embedded decision

The surrounding surface supplies separation without elevation.
<dialog open class="static" data-dialog="squared" aria-labelledby="event-dialog-title">
  <section data-media class="bg-primary">
    <header>
      <h3 id="event-dialog-title">Team event</h3>
      <button type="button" data-button="fab" class="inline" aria-label="Share event">
        <i class="material-icons" aria-hidden="true">share</i>
      </button>
    </header>
    <section>May 24, 7:00 PM</section>
  </section>
</dialog>

<dialog open class="static" data-dialog="full-width" aria-labelledby="workspace-dialog-title">
  <header><h3 id="workspace-dialog-title">Workspace settings</h3></header>
  <section>Settings use the available viewport width.</section>
</dialog>

<dialog open class="static" data-dialog="no-shadow" aria-labelledby="embedded-dialog-title">
  <header><h3 id="embedded-dialog-title">Embedded decision</h3></header>
  <section>The surrounding surface supplies separation without elevation.</section>
</dialog>

Composition

A dialog accepts direct header, section andfooter children. The static utility keeps these open previews in the document flow. The default position centers the dialog.

Responsive behavior

Standard dialogs size to their content. The full-widthtoken leaves a one-rem viewport gap. Long body content scrolls without moving the header or footer actions.

Motion

Transitions and starting styles reveal a non-static dialog through opacity and a short vertical translation. The modal stays open withdata-closing while its surface and backdrop animate, thenclose() completes the exit.

The static utility excludes documentation previews and embedded dialogs from this motion. When a user requests reduced motion, the dialog and its backdrop change state without transitions or spatial movement.

Accessibility

The examples connect each dialog to its heading witharia-labelledby. A dialog opened withshowModal() blocks the page and supports Escape. Focus behavior follows the native dialog API.

API

Dialog elements, attributes, states and tokens
NameTypeDefaultDescription
dialogElementClosedReceives centered, elevated surface styling.
openStateAbsentDisplays the dialog with its flex layout.
data-dialog="squared"Attribute tokenStandard shapeApplies the squared card dimensions and media layout.
full-widthAttribute tokenContent widthExpands the dialog to the available viewport width with an outer gap.
no-shadowAttribute token--shadow-2xlRemoves dialog elevation.
--dialog-radiusTokenTheme valueControls the corner radius of standard dialogs.
--motion-duration-base / --motion-easing-enter / --motion-easing-exitMotion token200ms / ease-out / ease-inControl supported opening and closing transitions for the dialog surface and backdrop.