Dialog
A modal, interactive content box that can be submitted or dismissed.
Code
<script lang="ts">
import { Dialog } from '@geoffcox/sterling-svelte';
</script>
<Dialog bind:open bind:returnValue>
<!-- Add content snippet or header, body, and footer snippets -->
</Dialog>
Members
| Property Name | Type | Default | Comment |
---|
| backdropCloses | boolean | null | undefined | false |
| body | Snippet | undefined | undefined |
| content | Snippet | undefined | undefined |
| footer | Snippet | undefined | undefined |
| header | Snippet| undefined | undefined |
| headerTitle | string | Snippet | undefined | undefined |
| open | boolean | null | undefined | false |
| returnValue | string | undefined | '' |
| variant | string | '' |
Considerations
- The dialog is always modal.
- The cancel event is only raised when the escape key is pressed.
- Includes HTMLDialogElement props, events, and methods.
Anatomy
dialog (<dialog>)
form (<form>)
content (<div>)
content (Snippet)
header (<div>)
header (Snippet)
title (<div>)
headerTitle (string | Snippet)
close (Button)
close-x (<div>)
body (<div>)
body (Snippet)
separator (<div>)
footer (<div>)
footer (Snippet)