Skip to content

Android components Overlays

StanceAlertDialog

Beta

Asks for a decision, with a danger style and loading state for destructive actions.

  • PlatformAndroid, Jetpack Compose
  • Builds onAlertDialog
  • Kindcomposable

Preview

Rendered by the Jetpack Compose library, not drawn by hand.

StanceAlertDialog on AndroidStanceAlertDialog on AndroidStanceAlertDialog on Android
StanceAlertDialog, Light appearance
Light
StanceAlertDialog, Dark appearance
Dark
StanceAlertDialog, High contrast appearance
High contrast

Usage

kotlin
var open by remember { mutableStateOf(false) }
StanceButton("Delete template", onClick = { open = true }, variant = StanceButtonVariant.Danger)
if (open) {
    StanceAlertDialog(
        title = "Delete this template?",
        message = "48 users will lose this signature. This cannot be undone.",
        confirmLabel = "Delete template",
        onConfirm = { open = false },
        onDismissRequest = { open = false },
        destructive = true,
    )
}

Accessibility

  • Uses the platform alert dialog semantics.

On other platforms