StylishAlertDialog

fun StylishAlertDialog(onDismissRequest: () -> Unit, modifier: Modifier = Modifier, icon: @Composable () -> Unit? = null, title: @Composable () -> Unit? = null, text: @Composable () -> Unit? = null, confirmButton: @Composable () -> Unit, dismissButton: @Composable () -> Unit? = null, containerColor: Color = MaterialTheme.colorScheme.surfaceContainerHigh, shape: Shape = RoundedCornerShape(StylishTheme.dimensions.connectedCornerRadius), tonalElevation: Dp = 1.dp, properties: DialogProperties = DialogProperties(usePlatformDefaultWidth = true))

A modal alert dialog that prompts the user for a decision, wrapping the Material 3 AlertDialog with Stylish defaults.

Supply title and text for the message, and wire confirmButton and dismissButton — typically TextButtons or the com.segnities007.stylishui.components.organisms.StylishDialogActions row. The dialog does not set up any events itself: callers own dismissal via onDismissRequest and each button's callback.

Parameters

onDismissRequest

Called when the user taps outside the dialog or presses the system back button.

modifier

Modifier applied to the dialog content.

icon

Optional icon shown above title (or above text when no title is provided).

title

Optional heading that states the purpose of the dialog.

text

Optional body text with the details of the dialog.

confirmButton

Composable for the action that confirms the proposed action, e.g. a TextButton labelled "OK".

dismissButton

Optional composable for the action that dismisses the dialog, e.g. a TextButton labelled "キャンセル".

containerColor

Background color of the dialog. Defaults to MaterialTheme.colorScheme.surfaceContainerHigh.

shape

Corner shape of the dialog. Defaults to RoundedCornerShape with StylishTheme.dimensions.connectedCornerRadius.

tonalElevation

Tonal elevation of the dialog surface. Defaults to 1.dp for a subtle lift.

properties

Platform-specific DialogProperties of the dialog. Defaults to using the platform default width.

See also