Dialogs
Inline here so they can be seen; a modal centred over the page on wide screens and a bottom sheet on narrow ones. Open buttons show the real modal.
confirmProps of confirm
<Dialog id="story-dialog-confirm" title="Remove Earth?" size="sm" inline>
<p>This also removes its 2 moons. You can't undo this.</p>
<Button slot="footer" variant="outline" tone="neutral" commandfor="story-dialog-confirm" command="close">Cancel</Button>
<Button slot="footer" tone="destructive" commandfor="story-dialog-confirm" command="close">
<Icon name="lucide:trash-2" />
Remove
</Button>
</Dialog>formProps of form
<Dialog id="story-dialog-form" title="Add a body" form inline>
<Input label="Name" name="name" autofocus={false} placeholder="Name" />
<Select label="Kind" name="kind" options={[{ value: "planet", label: "Planet" }, { value: "moon", label: "Moon" }, { value: "asteroid", label: "Asteroid" }]} />
<Input label="Mass in kilograms" name="mass" type="number" placeholder="Mass (kg)" />
<Button slot="footer" variant="outline" tone="neutral" commandfor="story-dialog-form" command="close">Cancel</Button>
<Button slot="footer" type="submit">Add</Button>
</Dialog>longProps of long
<Dialog id="story-dialog-long" scrollable title="A title that is long enough that it has to wrap onto a second line in the header" inline>
<p>Paragraphs stack with a gap between them. When the content is taller than th…
<Button slot="footer" commandfor="story-dialog-long" command="close">Done</Button>
</Dialog>no-closeProps of no-close
<Dialog id="story-dialog-no-close" title="Saved" size="sm" closeButton={false} inline>
<p>Your changes are saved.</p>
<Button slot="footer" commandfor="story-dialog-no-close" command="close">OK</Button>
</Dialog>modalProps of modal
<Dialog id="story-dialog-modal" title="Remove Earth?" size="sm" trigger="Open confirm (sm)">
<p>This also removes its 2 moons. You can't undo this.</p>
<Button slot="footer" variant="outline" tone="neutral" commandfor="story-dialog-modal" command="close">Cancel</Button>
<Button slot="footer" tone="destructive" commandfor="story-dialog-modal" command="close">
<Icon name="lucide:trash-2" />
Remove
</Button>
</Dialog>form-modalProps of form-modal
<Dialog id="story-dialog-form-modal" title="Add a body" form inline={false} trigger="Open form (md)">
<Input label="Name" name="name" autofocus placeholder="Name" />
<Select label="Kind" name="kind" options={[{ value: "planet", label: "Planet" }, { value: "moon", label: "Moon" }, { value: "asteroid", label: "Asteroid" }]} />
<Input label="Mass in kilograms" name="mass" type="number" placeholder="Mass (kg)" />
<Button slot="footer" variant="outline" tone="neutral" commandfor="story-dialog-form-modal" command="close">Cancel</Button>
<Button slot="footer" type="submit">Add</Button>
</Dialog>light-dismissProps of light-dismiss
<Dialog id="story-dialog-light-dismiss" title="Light dismiss" size="sm" trigger="Open (click outside closes)" lightDismiss>
<p>Click anywhere outside this dialog to close it.</p>
</Dialog>