AlertDialog
A structured confirmation with confirm and dismiss buttons.
var open by remember { mutableStateOf(false) }
Button(onClick = { open = true }) { Text("Delete") }
if (open) {
AlertDialog(
onDismissRequest = { open = false },
icon = { Icon(Icons.Filled.Delete, contentDescription = null) },
title = { Text("Delete item?") },
text = { Text("This action cannot be undone.") },
confirmButton = { TextButton(onClick = { open = false }) { Text("Delete") } },
dismissButton = { TextButton(onClick = { open = false }) { Text("Cancel") } }
)
}