Dialog

A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.

Edit profile

Make changes to your profile here. Click save when you're done.

Alert Dialog

A modal dialog that interrupts the user with important content and expects a response.

Are you absolutely sure?

This action cannot be undone. This will permanently delete your account and remove your data from our servers.

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::dialog::*;

#[component]
pub fn DialogAnatomy -> impl IntoView {
    view!{
        <Dialog>
            <DialogTrigger slot />
            <DialogHeader>
                <DialogTitle />
                <DialogDescription />
            </DialogHeader>
            <DialogContent/>
            <DialogFooter />
            <DialogClose/>
        </Dialog>
    }
}

API Reference

Dialog

Contains all the parts of an alert dialog.

Custom Attributes
NameTypeDefaultDescription
alertboolfalse

Specify whether or not alert styling should be used.

Implements global and dialog attributes.

DialogClose

An optional button that renders in the top-right corner and closes the dialog when clicked.

Implements global and button attributes.

DialogContent

Contains content to be rendered in the main body of the dialog.

Implements global attributes.

DialogDescription

A short description/subheading describing dialog content.

Implements global attributes.

DialogFooter

Displays at the bottom of the dialog, contains calls to action. Submit events such as button clicks in this area automatically trigger closing of the dialog.

Implements global attributes.

DialogHeader

Contains the dialog title and a description to be rendered in the open dialog.

Implements global attributes.

DialogTitle

The title of the dialog.

Implements global attributes.

DialogTrigger

Used to wrap other elements and trigger the dialog on click.

Note: the slot attribute is required.