Modal
A modal built on the native dialog element, so focus trapping, Escape and the top layer come for free. Closes on Escape, a backdrop click, or the close button.
Examples
Basic
Show code
<Modal bind:open title="Delete file">Are you sure?</Modal>Props
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | false | Whether the dialog is shown. Bind it with bind:open. |
title | string | — | Optional heading in the dialog header. |
The dialog is always in the DOM and shown via showModal(); bind open to control it.