MaterialAlertDialogContent

fun MaterialAlertDialogContent(modifier: Modifier = Modifier, title: @Composable () -> Unit? = null, text: @Composable () -> Unit? = null, confirmButton: @Composable () -> Unit, dismissButton: @Composable () -> Unit? = null, shape: Shape = MaterialTheme.shapes.medium, backgroundColor: Color = MaterialTheme.colors.surface, contentColor: Color = contentColorFor(backgroundColor))

Material Design alert dialog content

This composable provides the content layout for a Material alert dialog without creating the actual dialog itself. It's useful when you want to customize how the dialog is shown or integrate it with different dialog containers.

Alert dialogs interrupt users with urgent information, details, or actions.

The dialog will position its buttons based on the available space. By default it will try to place them horizontally next to each other and fallback to vertical placement if not enough space is available.

Parameters

modifier

Modifier to be applied to the layout of the dialog content surface.

title

The title of the Dialog which should specify the purpose of the Dialog. The title is not mandatory, because there may be sufficient information inside the text. Provided text style will be Typography.subtitle1.

text

The text which presents the details regarding the Dialog's purpose. Provided text style will be Typography.body2.

confirmButton

A button which is meant to confirm a proposed action. The dialog does not set up any events for this button so they need to be set up by the caller.

dismissButton

A button which is meant to dismiss the dialog. The dialog does not set up any events for this button so they need to be set up by the caller.

shape

Defines the Dialog's shape.

backgroundColor

The background color of the dialog surface.

contentColor

The preferred content color provided by this dialog surface to its children.