Composable Component

FailureConfirmationDialog

Shows a FailureConfirmationDialog with a failure icon and an optional short curved text.

FailureConfirmationDialogSample

@Composable
fun FailureConfirmationDialogSample() {
    var showConfirmation by remember { mutableStateOf(false) }
    Box(Modifier.fillMaxSize()) {
        FilledTonalButton(
            modifier = Modifier.align(Alignment.Center),
            onClick = { showConfirmation = true },
            label = { Text("Show Confirmation") },
        )
    }
    val text = "Failure"
    val style = ConfirmationDialogDefaults.curvedTextStyle
    FailureConfirmationDialog(
        visible = showConfirmation,
        onDismissRequest = { showConfirmation = false },
        curvedText = { confirmationDialogCurvedText(text, style) },
    )
}

FailureConfirmationDialogWithGenericFailureIconSample

@Composable
fun FailureConfirmationDialogWithGenericFailureIconSample() {
    var showConfirmation by remember { mutableStateOf(false) }
    Box(Modifier.fillMaxSize()) {
        FilledTonalButton(
            modifier = Modifier.align(Alignment.Center),
            onClick = { showConfirmation = true },
            label = { Text("Show Confirmation") },
        )
    }
    val text = "Failure"
    val style = ConfirmationDialogDefaults.curvedTextStyle
    FailureConfirmationDialog(
        visible = showConfirmation,
        onDismissRequest = { showConfirmation = false },
        curvedText = { confirmationDialogCurvedText(text, style) },
        content = { ConfirmationDialogDefaults.GenericFailureIcon() },
    )
}