# FailureConfirmationDialogContent

## Functions summary

|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/FailureConfirmationDialogContent.composable#FailureConfirmationDialogContent(kotlin.Function1,androidx.compose.ui.Modifier,androidx.wear.compose.material3.ConfirmationDialogColors,kotlin.Function0)( curvedText: (https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/CurvedScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, colors: https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ConfirmationDialogColors, content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/FailureConfirmationDialogContent.composable#FailureConfirmationDialogContent(kotlin.Function1,androidx.compose.ui.Modifier,androidx.wear.compose.material3.ConfirmationDialogColors,kotlin.Function0)` provides the content for a failure confirmation dialog with icon and an optional short curved text. |

## Functions

### FailureConfirmationDialogContent

Artifact: [androidx.wear.compose:compose-material3](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material3/ConfirmationDialog.kt+function:FailureConfirmationDialogContent) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
@Composable
fun FailureConfirmationDialogContent(
    curvedText: (CurvedScope.() -> Unit)?,
    modifier: Modifier = Modifier,
    colors: ConfirmationDialogColors = ConfirmationDialogDefaults.failureColors(),
    content: @Composable () -> Unit = { ConfirmationDialogDefaults.ConnectionFailureIcon() }
): Unit
```

`https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/FailureConfirmationDialogContent.composable#FailureConfirmationDialogContent(kotlin.Function1,androidx.compose.ui.Modifier,androidx.wear.compose.material3.ConfirmationDialogColors,kotlin.Function0)` provides the content for a failure confirmation dialog with icon and an optional short curved text. This variation of confirmation dialog indicates an unsuccessful operation or action.

Prefer using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/FailureConfirmationDialog.composable#FailureConfirmationDialog(kotlin.Boolean,kotlin.Function0,kotlin.Function1,androidx.compose.ui.Modifier,androidx.wear.compose.material3.ConfirmationDialogColors,androidx.compose.ui.window.DialogProperties,kotlin.Long,kotlin.Function0)` directly, which provides built-in animations when showing/hiding the dialog. This composable may be used to provide the content for a confirmation dialog if custom show/hide animations are required.

Where user input is required, such as choosing to ok or cancel an action, use `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/AlertDialog.composable#AlertDialog(kotlin.Boolean,kotlin.Function0,kotlin.Function1,kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function1,kotlin.Function0,kotlin.Function0,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.layout.PaddingValues,androidx.compose.ui.window.DialogProperties,kotlin.Function1)` instead of `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/FailureConfirmationDialog.composable#FailureConfirmationDialog(kotlin.Boolean,kotlin.Function0,kotlin.Function1,androidx.compose.ui.Modifier,androidx.wear.compose.material3.ConfirmationDialogColors,androidx.compose.ui.window.DialogProperties,kotlin.Long,kotlin.Function0)`.

Example of `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/FailureConfirmationDialog.composable#FailureConfirmationDialog(kotlin.Boolean,kotlin.Function0,kotlin.Function1,androidx.compose.ui.Modifier,androidx.wear.compose.material3.ConfirmationDialogColors,androidx.compose.ui.window.DialogProperties,kotlin.Long,kotlin.Function0)` usage with default icon:

```kotlin
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.wear.compose.material3.ConfirmationDialog
import androidx.wear.compose.material3.ConfirmationDialogDefaults
import androidx.wear.compose.material3.FailureConfirmationDialog
import androidx.wear.compose.material3.FilledTonalButton
import androidx.wear.compose.material3.Text
import androidx.wear.compose.material3.confirmationDialogCurvedText

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) },
)
```

Example of `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/FailureConfirmationDialog.composable#FailureConfirmationDialog(kotlin.Boolean,kotlin.Function0,kotlin.Function1,androidx.compose.ui.Modifier,androidx.wear.compose.material3.ConfirmationDialogColors,androidx.compose.ui.window.DialogProperties,kotlin.Long,kotlin.Function0)` with the variant failure icon for a generic error.

```kotlin
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.wear.compose.material3.ConfirmationDialog
import androidx.wear.compose.material3.ConfirmationDialogDefaults
import androidx.wear.compose.material3.FailureConfirmationDialog
import androidx.wear.compose.material3.FilledTonalButton
import androidx.wear.compose.material3.Icon
import androidx.wear.compose.material3.Text
import androidx.wear.compose.material3.confirmationDialogCurvedText

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

| Parameters |
|---|---|
| `curvedText: (https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/CurvedScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)?` | A slot for displaying curved text content which will be shown along the bottom edge of the dialog. We recommend using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/package-summary#(androidx.wear.compose.foundation.CurvedScope).confirmationDialogCurvedText(kotlin.String,androidx.wear.compose.foundation.CurvedTextStyle)` for this parameter, which will give the default sweep angle and padding. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier = Modifier` | Modifier to be applied to the confirmation content. |
| `colors: https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ConfirmationDialogColors = ConfirmationDialogDefaults.failureColors()` | A `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ConfirmationDialogColors` object for customizing the colors used in this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/FailureConfirmationDialog.composable#FailureConfirmationDialog(kotlin.Boolean,kotlin.Function0,kotlin.Function1,androidx.compose.ui.Modifier,androidx.wear.compose.material3.ConfirmationDialogColors,androidx.compose.ui.window.DialogProperties,kotlin.Long,kotlin.Function0)`. |
| `content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html = { ConfirmationDialogDefaults.ConnectionFailureIcon() }` | A slot for displaying an icon inside the confirmation dialog, which can be animated. The default value is `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ConfirmationDialogDefaults#ConnectionFailureIcon(androidx.compose.ui.Modifier)`, which shows a broken connection to the phone icon. Alternatively, provide `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ConfirmationDialogDefaults#GenericFailureIcon(androidx.compose.ui.Modifier)` for a generic error icon. |