Skip to content

Dialog

Built on the native <dialog> element, which supplies focus trapping and top-layer stacking for free. Any element elsewhere on the page can open or close it via data-dialog-open/data-dialog-close.

Dialog title

Dialog content.

  • variant: modal (default), drawer
  • size: regular (default), large
<Button data-dialog-open="example-dialog">Open dialog</Button>
<Dialog id="example-dialog">
<h2>Dialog title</h2>
<p>Dialog content.</p>
<Button data-dialog-close>Close</Button>
</Dialog>