The AlertDialog primitive provides an accessible, composable modal dialog for critical user confirmations (such as destructive actions).
## Component Structure
```rust
let mut open = use_signal(|| false);
rsx! {
button { onclick: move |_| open.set(true), type: "button", "Show Alert Dialog" }
AlertDialog { open: open(), on_open_change: move |v| open.set(v),
AlertDialogTitle { "Title" }
AlertDialogDescription { "Description" }
AlertDialogActions {
AlertDialogCancel { "Cancel" }
AlertDialogAction { on_click: move |_| { /* destructive action */ }, "Confirm" }
}
}
}
```
### Components
- **AlertDialog**: Provides context, manages open state, renders the backdrop and the content panel.
- **AlertDialogTitle**: The dialog's heading.
- **AlertDialogDescription**: Additional description for the dialog.
- **AlertDialogActions**: Container for action buttons.
- **AlertDialogAction**: Main action button (e.g., confirm/delete). Closes dialog and calls optional `on_click`.
- **AlertDialogCancel**: Cancel/close button. Closes dialog and calls optional `on_click`.