Modal
A dialog over the page, built on the native dialog element. The browser handles focus, Esc and the backdrop.
| Name | Type | What it does |
|---|---|---|
modal | component | On a <dialog>. Open it with .showModal(); a <form method="dialog"> closes it |
Modal
<button class="btn" onclick="document.getElementById('demo-modal').showModal()">Open modal</button>
<dialog class="modal glow" id="demo-modal">
<p class="card-title">Delete this album?</p>
<p>This removes 2,418 photos. It can't be undone.</p>
<form method="dialog" class="card-actions">
<button class="btn btn-ghost">Cancel</button>
<button class="btn btn-danger">Delete</button>
</form>
</dialog>