StellarUI

<stellar-dialog>

Modal and drawer surface backed by a native <dialog> element, with header, actions, footer, and placement behavior.

Properties

Component
Example

Preview

Open dialog

Dialog title

This is a native dialog-backed surface.

Cancel Confirm

Markup

Copy
<stellar-button data-dialog="open dialog-example">Open dialog</stellar-button>
<stellar-dialog id="dialog-example">
  <h3 slot="header">Dialog title</h3>
  <p>This is a native dialog-backed surface.</p>
  <div slot="footer">
    <stellar-button appearance="ghost" data-dialog="close">Cancel</stellar-button>
    <stellar-button tone="primary" data-dialog="close">Confirm</stellar-button>
  </div>
</stellar-dialog>

API

Complete props, events, slots, and implementation notes for the shipped dialog.

Props

PropTypeDefaultNotes
openbooleanfalseControls the native dialog open state and drives showModal() and close().
placementcenter | top | bottom | start | end | fullcenterChanges the presentation from a centered modal to edge drawers or a fullscreen sheet.
light-dismissbooleanfalseAllows backdrop clicks to close the dialog instead of pulsing it.
reset-scrollbooleanfalseResets the body scroll position when the dialog closes.

Events

EventSourceNotes
before-openstellar-dialogCancellable event fired before the dialog is shown.
openstellar-dialogEmitted after the show animation completes.
before-closestellar-dialogCancellable event fired before dismissal. The source element is available as event.detail.source.
closestellar-dialogEmitted after the hide animation completes and the native dialog closes.

Slots

SlotNotes
defaultMain dialog content rendered inside the scrollable body.
headerOptional header content shown above the body.
actionsOptional header actions. Overrides the default close button when the header is present.
footerOptional footer content shown below the body.

Notes

  • The public tag is `stellar-dialog`, backed by a real native `<dialog>` and matching the shipped `open`, `placement`, `light-dismiss`, and `reset-scroll` contract.
  • Use the `header`, `actions`, and `footer` slots for the frame chrome. If `actions` is empty and a header exists, the dialog supplies a default close button there.
  • `before-open` and `before-close` are cancellable. `before-close` includes `event.detail.source` so app code can tell whether Escape, the backdrop, or a close button triggered dismissal.
  • Use `data-dialog="open <id>"` on external triggers and `data-dialog="close"` inside the dialog when you want declarative open and close wiring without extra scripts.