🌈 Create new beautiful Compose Gradients with our new wesite ->
Compose Component

FailureConfirmationDialog

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

FailureConfirmationDialog social preview

FailureConfirmationDialogSample

@Sampled
@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

@Sampled
@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() },
    )
}