pub fn confirm<R: Runtime>(
    parent_window: Option<&Window<R>>,
    title: impl AsRef<str>,
    message: impl AsRef<str>
) -> bool
Available on crate feature dialog only.
Expand description

Displays a dialog with a message and an optional title with an “ok” and a “cancel” button and wait for it to be closed.

This is a blocking operation, and should NOT be used when running on the main thread context.

Examples

use tauri::api::dialog::blocking::confirm;
let answer = confirm(Some(&window), "Tauri", "Are you sure?");
// do something with `answer`