StylishDeleteConfirmDialog

fun StylishDeleteConfirmDialog(title: String, modifier: Modifier = Modifier, message: String, confirmLabel: String, cancelLabel: String, onConfirm: () -> Unit, onDismiss: () -> Unit, titleMaxLines: Int = Int.MAX_VALUE, titleOverflow: TextOverflow = TextOverflow.Ellipsis, titleStyle: TextStyle = MaterialTheme.typography.titleLarge, messageMaxLines: Int = Int.MAX_VALUE, messageOverflow: TextOverflow = TextOverflow.Ellipsis, messageStyle: TextStyle = MaterialTheme.typography.bodyMedium, messageColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, cancelColors: ButtonColors? = null, confirmColors: ButtonColors? = null, confirmEnabled: Boolean = true, cancelEnabled: Boolean = true, animate: Boolean = true, properties: DialogProperties = DialogProperties(usePlatformDefaultWidth = false))

A confirmation dialog for destructive delete operations.

Displays a title, an explanatory message, and a confirm/cancel button pair inside a StylishDialogSurface. Always interpose this dialog before performing an irreversible action so the user can back out. Composes the StylishDialogSurface atom for the modal container and the StylishDialogActions organism for the button row.

Parameters

title

Heading text shown at the top of the dialog, e.g. "Delete record".

modifier

Modifier applied to the StylishDialogSurface's root card.

message

Body text explaining the consequence of confirming, rendered in messageColor.

confirmLabel

Text for the destructive-action button, e.g. "Delete".

cancelLabel

Text for the dismiss button, e.g. "Cancel".

onConfirm

Callback invoked when the user taps the confirm button. The caller is responsible for performing the deletion and dismissing the dialog.

onDismiss

Callback invoked when the user taps cancel or taps outside the dialog. The caller should dismiss the dialog.

titleMaxLines

Maximum lines for title. Defaults to Int.MAX_VALUE (unlimited).

titleOverflow

TextOverflow strategy for title. Defaults to TextOverflow.Ellipsis.

titleStyle

TextStyle for title. Defaults to MaterialTheme.typography.titleLarge.

messageMaxLines

Maximum lines for message. Defaults to Int.MAX_VALUE (unlimited).

messageOverflow

TextOverflow strategy for message. Defaults to TextOverflow.Ellipsis.

messageStyle

TextStyle for message. Defaults to MaterialTheme.typography.bodyMedium.

messageColor

Color for message. Defaults to MaterialTheme.colorScheme.onSurfaceVariant.

cancelColors

Optional ButtonColors for the cancel button, forwarded to StylishDialogActions. When null (the default), the subdued StylishDialogActions defaults are used.

confirmColors

Optional ButtonColors for the confirm button, forwarded to StylishDialogActions. When null (the default), the prominent StylishDialogActions defaults are used.

confirmEnabled

Whether the confirm button is interactive. Defaults to true. Set to false to block confirmation until preconditions are met.

cancelEnabled

Whether the cancel button is interactive. Defaults to true.

animate

When true (the default), the dialog plays the scale-and-fade entrance animation of StylishDialogSurface. When false, the dialog appears immediately.

properties

DialogProperties forwarded to StylishDialogSurface, e.g. to disable dismissal on back press or on tapping outside. Defaults to DialogProperties with usePlatformDefaultWidth = false.

See also