AlertDialog

fun AlertDialog(showDialog: Boolean, onCancel: () -> Unit, onOk: () -> Unit, modifier: Modifier = Modifier, icon: @Composable () -> Unit? = null, title: String? = null, message: String? = null, okButtonContentDescription: String = stringResource(android.R.string.ok), cancelButtonContentDescription: String = stringResource(android.R.string.cancel), state: ScalingLazyColumnState = rememberColumnState( ScalingLazyColumnDefaults.responsive(), ), content: ScalingLazyListScope.() -> Unit? = null)

This component is an alternative to AlertContent, providing the following:

  • a convenient way of passing a title and a message;

  • additional content can be specified between the message and the buttons

  • default positive and negative buttons;

  • wrapped in a Dialog;


fun AlertDialog(showDialog: Boolean, onDismiss: () -> Unit, modifier: Modifier = Modifier, icon: @Composable () -> Unit? = null, title: String? = null, message: String? = null, state: ScalingLazyColumnState = rememberColumnState( ScalingLazyColumnDefaults.responsive(), ), content: ScalingLazyListScope.() -> Unit? = null)

This component is an alternative to AlertContent, providing the following:

  • a convenient way of passing a title and a message;

  • slot for scrollable content (including stack of Chips for options);

  • wrapped in a Dialog;