FailureConfirmationDialog

Composable Component

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

Android
@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.FailureIcon() },
)

Parameters

visibleA boolean indicating whether the confirmation dialog should be displayed.
onDismissRequestA 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.
curvedTextA 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.
modifierModifier to be applied to the confirmation content.
colorsA ConfirmationDialogColors object for customizing the colors used in this FailureConfirmationDialog.
propertiesAn optional DialogProperties object for configuring the dialog's behavior.
durationMillisThe duration in milliseconds for which the dialog is displayed. This value will be adjusted by the accessibility manager according to the content displayed.
contentA slot for displaying an icon inside the confirmation dialog, which can be animated. Defaults to ConfirmationDialogDefaults.FailureIcon.

Create your own Component Library

Material Components are meant to be used as is and they do not allow customizations. To build your own Jetpack Compose component library use Compose Unstyled