Component
Dialog
A FormaUI alert dialog — a modal that interrupts the user for a decision or acknowledgement, delegating to Material 3's AlertDialog.
dev.formaui.components.dialog
Preview
This toggle is site chrome only — the preview has its own light/dark switch inside.
Live preview
Live preview — ~37 MB development build
Usage
var showDialog by remember { mutableStateOf(true) }
if (showDialog) {
FormaAlertDialog(
onDismissRequest = { showDialog = false },
title = "Delete payment?",
text = "This action can't be undone.",
confirmButton = {
FormaButton(onClick = {}) { Text("Delete") }
},
dismissButton = {
FormaButton(onClick = { showDialog = false }, variant = FormaButtonVariant.Text) { Text("Cancel") }
},
)
}FormaAlertDialog
Modal alert dialog for a decision or acknowledgement; shown while composed, with hoisted visibility state.
FormaFullScreenDialog
Full-screen modal dialog for a focused multi-step task, with a top bar hosting Close, the title, and an optional confirm action.
Supporting API
- FormaDialogDefaultsobject
- Default values for FormaUI dialogs; shape returns FormaTheme.shapes.xl.
Accessibility
Both variants delegate dismissal to the underlying Dialog, so an outside tap or back press routes to onDismissRequest; FormaFullScreenDialog's Close control is a text FormaButton, so it announces its label without needing a contentDescription. Pass contentDescription = null on FormaAlertDialog's icon when the title already conveys the same meaning.