Logo

Dialog

The HTML <dialog> element for modal dialogs.

How does that work?

Use the HTML dialog element together with the popover API.

<button popovertarget="my-dialog">Open dialog</button>
<dialog id="my-dialog" popover>
  <strong>Dialog</strong>
  <p>This is a dialog</p>
  <button popovertarget="my-dialog" popovertargetaction="hide">Close</button>
</dialog>