Components / ConfirmDialog

ConfirmDialog

A question before something that cannot be undone.

Example

The component itself, running in WebAssembly, beside its code in a playground. Try it.

Code

use ravenrs::prelude::*;

fn confirm_dialog() -> impl View {
    let confirm = ConfirmDialog::new();
    let asker = confirm.clone();
    VStack::new((
        Button::new("Delete").style(ButtonStyle::Danger).on_click(move || {
            asker.ask("Delete this record?", "This cannot be undone.", "Delete", || {});
        }),
        confirm,
    ))
}

Open in the playground, with every example →

Full API of ConfirmDialog →