---
title: "FailureConfirmationDialog"
description: "Shows a `FailureConfirmationDialog` with a failure icon and an optional short curved text. This
variation of confirmation dialog indicates an unsuccessful operation or action."
type: "component"
---

<div class='type'>Composable Component</div>



Shows a `FailureConfirmationDialog` with a failure icon and an optional short curved text. This
variation of confirmation dialog indicates an unsuccessful operation or action.

<a id='references'></a>

<div class='sourceset sourceset-android'>Android</div>


```kotlin
@Composable
public fun FailureConfirmationDialog(
    visible: Boolean,
    onDismissRequest: () -> Unit,
    curvedText: (CurvedScope.() -> Unit)?,
    modifier: Modifier = Modifier,
    colors: ConfirmationDialogColors = ConfirmationDialogDefaults.failureColors(),
    properties: DialogProperties = DialogProperties(),
    durationMillis: Long = ConfirmationDialogDefaults.DurationMillis,
    content: @Composable () -> Unit = { ConfirmationDialogDefaults.ConnectionFailureIcon() },
)
```


#### Parameters

| | |
| --- | --- |
| visible | A boolean indicating whether the confirmation dialog should be displayed. |
| onDismissRequest | A lambda function to be called when the dialog is dismissed - either by swiping right or when the `durationMillis` has passed. Implementation of this lambda must remove the dialog from the composition hierarchy e.g. by setting `visible` to false. |
| curvedText | A slot for displaying curved text content which will be shown along the bottom edge of the dialog. We recommend using `confirmationDialogCurvedText` for this parameter, which will give the default sweep angle and padding. |
| modifier | Modifier to be applied to the confirmation content. |
| colors | A `ConfirmationDialogColors` object for customizing the colors used in this `FailureConfirmationDialog`. |
| properties | An optional `DialogProperties` object for configuring the dialog's behavior. |
| durationMillis | The duration in milliseconds for which the dialog is displayed. This value will be adjusted by the accessibility manager according to the content displayed. |
| content | A slot for displaying an icon inside the confirmation dialog, which can be animated. The default value is `ConfirmationDialogDefaults.ConnectionFailureIcon`, which shows a broken connection to the phone icon. Alternatively, provide `ConfirmationDialogDefaults.GenericFailureIcon` for a generic error icon. |






## Code Examples
### FailureConfirmationDialogSample
```kotlin
@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
```kotlin
@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() },
    )
}
```

