AlertDialogContent

Functions summary

Unit
@Composable
AlertDialogContent(
    title: @Composable () -> Unit,
    modifier: Modifier,
    icon: (@Composable () -> Unit)?,
    text: (@Composable () -> Unit)?,
    verticalArrangement: Arrangement.Vertical,
    contentPadding: PaddingValues,
    content: (ScalingLazyListScope.() -> Unit)?
)

This AlertDialogContent overload provides the content for an AlertDialog without any dedicated slots for buttons.

Unit
@Composable
AlertDialogContent(
    edgeButton: @Composable BoxScope.() -> Unit,
    title: @Composable () -> Unit,
    modifier: Modifier,
    icon: (@Composable () -> Unit)?,
    text: (@Composable () -> Unit)?,
    verticalArrangement: Arrangement.Vertical,
    contentPadding: PaddingValues,
    content: (ScalingLazyListScope.() -> Unit)?
)

This AlertDialogContent overload provides the content for an AlertDialog with a single EdgeButton to confirm an action.

Unit
@Composable
AlertDialogContent(
    title: @Composable () -> Unit,
    transformationSpec: TransformationSpec,
    modifier: Modifier,
    icon: (@Composable () -> Unit)?,
    text: (@Composable () -> Unit)?,
    verticalArrangement: Arrangement.Vertical,
    contentPadding: @Composable (Boolean) -> PaddingValues,
    content: (TransformingLazyColumnScope.() -> Unit)?
)

This overload provides the content for an AlertDialog without any dedicated slots for buttons and a TransformationSpec for advanced control over transformations of scrolling content..

Unit
@Composable
AlertDialogContent(
    confirmButton: @Composable RowScope.() -> Unit,
    title: @Composable () -> Unit,
    dismissButton: @Composable RowScope.() -> Unit,
    modifier: Modifier,
    icon: (@Composable () -> Unit)?,
    text: (@Composable () -> Unit)?,
    verticalArrangement: Arrangement.Vertical,
    contentPadding: PaddingValues,
    content: (ScalingLazyListScope.() -> Unit)?
)

This AlertDialogContent overload provides the content for an AlertDialog with 2 buttons to confirm or dismiss an action.

Unit
@Composable
AlertDialogContent(
    edgeButton: @Composable BoxScope.() -> Unit,
    title: @Composable () -> Unit,
    transformationSpec: TransformationSpec,
    modifier: Modifier,
    icon: (@Composable () -> Unit)?,
    text: (@Composable () -> Unit)?,
    verticalArrangement: Arrangement.Vertical,
    contentPadding: PaddingValues,
    content: (TransformingLazyColumnScope.() -> Unit)?
)

This overload provides the content for an AlertDialog with a single EdgeButton to confirm an action and a TransformationSpec for advanced control over transformations of scrolling content.

Unit
@Composable
AlertDialogContent(
    confirmButton: @Composable RowScope.() -> Unit,
    title: @Composable () -> Unit,
    dismissButton: @Composable RowScope.() -> Unit,
    transformationSpec: TransformationSpec,
    modifier: Modifier,
    icon: (@Composable () -> Unit)?,
    text: (@Composable () -> Unit)?,
    verticalArrangement: Arrangement.Vertical,
    contentPadding: PaddingValues,
    content: (TransformingLazyColumnScope.() -> Unit)?
)

This overload provides the content for an AlertDialog with 2 buttons to confirm or dismiss an action and a TransformationSpec for advanced control over transformations of scrolling content.

Functions

AlertDialogContent

@Composable
fun AlertDialogContent(
    title: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    icon: (@Composable () -> Unit)? = null,
    text: (@Composable () -> Unit)? = null,
    verticalArrangement: Arrangement.Vertical = AlertDialogDefaults.VerticalArrangement,
    contentPadding: PaddingValues = if (icon != null) { AlertDialogDefaults.contentWithIconPadding() } else { AlertDialogDefaults.contentPadding() },
    content: (ScalingLazyListScope.() -> Unit)? = null
): Unit

This AlertDialogContent overload provides the content for an AlertDialog without any dedicated slots for buttons. Prefer using AlertDialog directly, which provides built-in animations and a streamlined API. This composable may be used to provide the content for an alert dialog if custom animations are required.

AlertDialogContent now additionally offers an equivalent overload using TransformingLazyColumn, which is recommended to achieve a consistent Material 3 scrolling experience throughout your app

Parameters
title: @Composable () -> Unit

A slot for displaying the title of the dialog. Title should contain a summary of the dialog's purpose or content and should not exceed 3 lines of text. By default, TextOverflow.Ellipsis will be applied when text exceeds 3 lines.

modifier: Modifier = Modifier

Modifier to be applied to the dialog content.

icon: (@Composable () -> Unit)? = null

Optional slot for an icon to be shown at the top of the dialog.

text: (@Composable () -> Unit)? = null

Optional slot for displaying the message of the dialog below the title. Should contain additional text that presents further details about the dialog's purpose if the title is insufficient.

verticalArrangement: Arrangement.Vertical = AlertDialogDefaults.VerticalArrangement

The vertical arrangement of the dialog's children. There is a default padding between icon, title, and text, which will be added to the spacing specified in this verticalArrangement parameter.

contentPadding: PaddingValues = if (icon != null) { AlertDialogDefaults.contentWithIconPadding() } else { AlertDialogDefaults.contentPadding() }

The padding to apply around the entire dialog's contents. It is recommended to use the defaults, which adjust to reduce the top padding when an icon is present.

content: (ScalingLazyListScope.() -> Unit)? = null

A slot for additional content, displayed within a scrollable ScalingLazyColumn.

AlertDialogContent

@Composable
fun AlertDialogContent(
    edgeButton: @Composable BoxScope.() -> Unit,
    title: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    icon: (@Composable () -> Unit)? = null,
    text: (@Composable () -> Unit)? = null,
    verticalArrangement: Arrangement.Vertical = AlertDialogDefaults.VerticalArrangement,
    contentPadding: PaddingValues = if (icon != null) { AlertDialogDefaults.contentWithIconPadding() } else { AlertDialogDefaults.contentPadding() },
    content: (ScalingLazyListScope.() -> Unit)? = null
): Unit

This AlertDialogContent overload provides the content for an AlertDialog with a single EdgeButton to confirm an action. Prefer using AlertDialog directly, which provides built-in animations and a streamlined API. This composable may be used to provide the content for an alert dialog if custom animations are required.

AlertDialogContent now additionally offers an equivalent overload using TransformingLazyColumn, which is recommended to achieve a consistent Material 3 scrolling experience throughout your app

Parameters
edgeButton: @Composable BoxScope.() -> Unit

Slot for an EdgeButton indicating positive sentiment. Clicking the button must remove the dialog from the composition hierarchy. It's recommended to use AlertDialogDefaults.EdgeButton in this slot with onClick callback. Note that when using an EdgeButton which is not Medium size, the contentPadding parameters should be specified.

title: @Composable () -> Unit

A slot for displaying the title of the dialog. Title should contain a summary of the dialog's purpose or content and should not exceed 3 lines of text. By default, TextOverflow.Ellipsis will be applied when text exceeds 3 lines.

modifier: Modifier = Modifier

Modifier to be applied to the dialog content.

icon: (@Composable () -> Unit)? = null

Optional slot for an icon to be shown at the top of the dialog.

text: (@Composable () -> Unit)? = null

Optional slot for displaying the message of the dialog below the title. Should contain additional text that presents further details about the dialog's purpose if the title is insufficient.

verticalArrangement: Arrangement.Vertical = AlertDialogDefaults.VerticalArrangement

The vertical arrangement of the dialog's children. There is a default padding between icon, title, and text, which will be added to the spacing specified in this verticalArrangement parameter.

contentPadding: PaddingValues = if (icon != null) { AlertDialogDefaults.contentWithIconPadding() } else { AlertDialogDefaults.contentPadding() }

The padding to apply around the entire dialog's contents. Bottom padding will be ignored and default spacing for the EdgeButton will be used. It is recommended to use the defaults, which adjust to reduce the top padding when an icon is present.

content: (ScalingLazyListScope.() -> Unit)? = null

A slot for additional content, displayed within a scrollable ScalingLazyColumn.

@Composable
fun AlertDialogContent(
    title: @Composable () -> Unit,
    transformationSpec: TransformationSpec,
    modifier: Modifier = Modifier,
    icon: (@Composable () -> Unit)? = null,
    text: (@Composable () -> Unit)? = null,
    verticalArrangement: Arrangement.Vertical = AlertDialogDefaults.VerticalArrangement,
    contentPadding: @Composable (Boolean) -> PaddingValues = { isScrollable: Boolean -> if (icon != null) { AlertDialogDefaults.buttonStackWithIconContentPadding(isScrollable) } else { AlertDialogDefaults.buttonStackContentPadding(isScrollable) } },
    content: (TransformingLazyColumnScope.() -> Unit)? = null
): Unit

This overload provides the content for an AlertDialog without any dedicated slots for buttons and a TransformationSpec for advanced control over transformations of scrolling content.. Prefer using AlertDialog directly, which provides built-in animations and a streamlined API. This composable may be used to provide the content for an alert dialog if custom animations are required.

Parameters
title: @Composable () -> Unit

A slot for displaying the title of the dialog. Title should contain a summary of the dialog's purpose or content and should not exceed 3 lines of text. By default, TextOverflow.Ellipsis will be applied when text exceeds 3 lines.

transformationSpec: TransformationSpec

A spec that defines how items inside the TransformingLazyColumn transform and animate as they are scrolled. It is recommended to create a spec using rememberTransformationSpec. This parameter is the key differentiator from the standard AlertDialog overload, which uses a ScalingLazyColumn without per-item customizable animations. The provided transformationSpec is automatically applied only to the dialog's standard components (title, text, and buttons), while additional items in content lambda need to be handled manually, by applying a TransformationSpec to each of them. First item has a fixed spec, with a reduced transition area, so that the top item does not appear scaled or faded when the dialog is initially displayed.

modifier: Modifier = Modifier

Modifier to be applied to the dialog content.

icon: (@Composable () -> Unit)? = null

Optional slot for an icon to be shown at the top of the dialog.

text: (@Composable () -> Unit)? = null

Optional slot for displaying the message of the dialog below the title. Should contain additional text that presents further details about the dialog's purpose if the title is insufficient.

verticalArrangement: Arrangement.Vertical = AlertDialogDefaults.VerticalArrangement

The vertical arrangement of the dialog's children. There is a default padding between icon, title, and text, which will be added to the spacing specified in this verticalArrangement parameter.

contentPadding: @Composable (Boolean) -> PaddingValues = { isScrollable: Boolean -> if (icon != null) { AlertDialogDefaults.buttonStackWithIconContentPadding(isScrollable) } else { AlertDialogDefaults.buttonStackContentPadding(isScrollable) } }

The padding to apply around the entire dialog's contents. It is recommended to use the defaults, which adjust to reduce the top padding when an icon is present.

content: (TransformingLazyColumnScope.() -> Unit)? = null

A slot for additional content, displayed within a scrollable TransformingLazyColumn. To ensure that your custom items animate consistently with the rest of the dialog, we recommend applying a TransformationSpec to each of them.

AlertDialogContent

@Composable
fun AlertDialogContent(
    confirmButton: @Composable RowScope.() -> Unit,
    title: @Composable () -> Unit,
    dismissButton: @Composable RowScope.() -> Unit,
    modifier: Modifier = Modifier,
    icon: (@Composable () -> Unit)? = null,
    text: (@Composable () -> Unit)? = null,
    verticalArrangement: Arrangement.Vertical = AlertDialogDefaults.VerticalArrangement,
    contentPadding: PaddingValues = if (icon != null) { AlertDialogDefaults.confirmDismissWithIconContentPadding() } else { AlertDialogDefaults.confirmDismissContentPadding() },
    content: (ScalingLazyListScope.() -> Unit)? = null
): Unit

This AlertDialogContent overload provides the content for an AlertDialog with 2 buttons to confirm or dismiss an action. Prefer using AlertDialog directly, which provides built-in animations and a streamlined API. This composable may be used to provide the content for an alert dialog if custom animations are required.

AlertDialogContent now additionally offers an equivalent overload using TransformingLazyColumn, which is recommended to achieve a consistent Material 3 scrolling experience throughout your app

Parameters
confirmButton: @Composable RowScope.() -> Unit

A slot for a Button indicating positive sentiment. Clicking the button must remove the dialog from the composition hierarchy. It's recommended to use AlertDialogDefaults.ConfirmButton in this slot with onClick callback.

title: @Composable () -> Unit

A slot for displaying the title of the dialog. Title should contain a summary of the dialog's purpose or content and should not exceed 3 lines of text. By default, TextOverflow.Ellipsis will be applied when text exceeds 3 lines.

dismissButton: @Composable RowScope.() -> Unit

A slot for a Button indicating negative sentiment. Clicking the button must remove the dialog from the composition hierarchy. It's recommended to use AlertDialogDefaults.DismissButton in this slot with onClick callback.

modifier: Modifier = Modifier

Modifier to be applied to the dialog content.

icon: (@Composable () -> Unit)? = null

Optional slot for an icon to be shown at the top of the dialog.

text: (@Composable () -> Unit)? = null

Optional slot for displaying the message of the dialog below the title. Should contain additional text that presents further details about the dialog's purpose if the title is insufficient.

verticalArrangement: Arrangement.Vertical = AlertDialogDefaults.VerticalArrangement

The vertical arrangement of the dialog's children. There is a default padding between icon, title, and text, which will be added to the spacing specified in this verticalArrangement parameter.

contentPadding: PaddingValues = if (icon != null) { AlertDialogDefaults.confirmDismissWithIconContentPadding() } else { AlertDialogDefaults.confirmDismissContentPadding() }

The padding to apply around the entire dialog's contents. It is recommended to use the defaults, which adjust to reduce the top padding when an icon is present.

content: (ScalingLazyListScope.() -> Unit)? = null

A slot for additional content, displayed within a scrollable ScalingLazyColumn.

@Composable
fun AlertDialogContent(
    edgeButton: @Composable BoxScope.() -> Unit,
    title: @Composable () -> Unit,
    transformationSpec: TransformationSpec,
    modifier: Modifier = Modifier,
    icon: (@Composable () -> Unit)? = null,
    text: (@Composable () -> Unit)? = null,
    verticalArrangement: Arrangement.Vertical = AlertDialogDefaults.VerticalArrangement,
    contentPadding: PaddingValues = if (icon != null) { AlertDialogDefaults.contentWithIconPadding() } else { AlertDialogDefaults.contentPadding() },
    content: (TransformingLazyColumnScope.() -> Unit)? = null
): Unit

This overload provides the content for an AlertDialog with a single EdgeButton to confirm an action and a TransformationSpec for advanced control over transformations of scrolling content. Prefer using AlertDialog directly, which provides built-in animations and a streamlined API. This composable may be used to provide the content for an alert dialog if custom animations are required.

Parameters
edgeButton: @Composable BoxScope.() -> Unit

Slot for an EdgeButton indicating positive sentiment. Clicking the button must remove the dialog from the composition hierarchy. It's recommended to use AlertDialogDefaults.EdgeButton in this slot with onClick callback. Note that when using an EdgeButton which is not Medium size, the contentPadding parameters should be specified.

title: @Composable () -> Unit

A slot for displaying the title of the dialog. Title should contain a summary of the dialog's purpose or content and should not exceed 3 lines of text. By default, TextOverflow.Ellipsis will be applied when text exceeds 3 lines.

transformationSpec: TransformationSpec

A spec that defines how items inside the TransformingLazyColumn transform and animate as they are scrolled. It is recommended to create a spec using rememberTransformationSpec. This parameter is the key differentiator from the standard AlertDialog overload, which uses a ScalingLazyColumn without per-item customizable animations. The provided transformationSpec is automatically applied only to the dialog's standard components (title, text, and buttons), while additional items in content lambda need to be handled manually, by applying a TransformationSpec to each of them. First item has a fixed spec, with a reduced transition area, so that the top item does not appear scaled or faded when the dialog is initially displayed.

transformationSpec: TransformationSpec

A spec that defines how components inside the TransformingLazyColumn transform and animate as they are scrolled. It is recommended to create a spec using rememberTransformationSpec. The provided transformationSpec is automatically applied only to the dialog's standard components (icon, title, text, and buttons). This parameter is the key differentiator from the standard AlertDialog overload, which uses a ScalingLazyColumn with automatic non-customizable animations.

modifier: Modifier = Modifier

Modifier to be applied to the dialog content.

icon: (@Composable () -> Unit)? = null

Optional slot for an icon to be shown at the top of the dialog.

text: (@Composable () -> Unit)? = null

Optional slot for displaying the message of the dialog below the title. Should contain additional text that presents further details about the dialog's purpose if the title is insufficient.

verticalArrangement: Arrangement.Vertical = AlertDialogDefaults.VerticalArrangement

The vertical arrangement of the dialog's children. There is a default padding between icon, title, and text, which will be added to the spacing specified in this verticalArrangement parameter.

contentPadding: PaddingValues = if (icon != null) { AlertDialogDefaults.contentWithIconPadding() } else { AlertDialogDefaults.contentPadding() }

The padding to apply around the entire dialog's contents. Bottom padding will be ignored and default spacing for the EdgeButton will be used. It is recommended to use the defaults, which adjust to reduce the top padding when an icon is present.

content: (TransformingLazyColumnScope.() -> Unit)? = null

A slot for additional content, displayed within a scrollable TransformingLazyColumn.To ensure that your custom items animate consistently with the rest of the dialog, we recommend applying a TransformationSpec to each of them.

@Composable
fun AlertDialogContent(
    confirmButton: @Composable RowScope.() -> Unit,
    title: @Composable () -> Unit,
    dismissButton: @Composable RowScope.() -> Unit,
    transformationSpec: TransformationSpec,
    modifier: Modifier = Modifier,
    icon: (@Composable () -> Unit)? = null,
    text: (@Composable () -> Unit)? = null,
    verticalArrangement: Arrangement.Vertical = AlertDialogDefaults.VerticalArrangement,
    contentPadding: PaddingValues = if (icon != null) { AlertDialogDefaults.confirmDismissWithIconContentPadding() } else { AlertDialogDefaults.confirmDismissContentPadding() },
    content: (TransformingLazyColumnScope.() -> Unit)? = null
): Unit

This overload provides the content for an AlertDialog with 2 buttons to confirm or dismiss an action and a TransformationSpec for advanced control over transformations of scrolling content. Prefer using AlertDialog directly, which provides built-in animations and a streamlined API. This composable may be used to provide the content for an alert dialog if custom animations are required.

Parameters
confirmButton: @Composable RowScope.() -> Unit

A slot for a Button indicating positive sentiment. Clicking the button must remove the dialog from the composition hierarchy. It's recommended to use AlertDialogDefaults.ConfirmButton in this slot with onClick callback.

title: @Composable () -> Unit

A slot for displaying the title of the dialog. Title should contain a summary of the dialog's purpose or content and should not exceed 3 lines of text. By default, TextOverflow.Ellipsis will be applied when text exceeds 3 lines.

dismissButton: @Composable RowScope.() -> Unit

A slot for a Button indicating negative sentiment. Clicking the button must remove the dialog from the composition hierarchy. It's recommended to use AlertDialogDefaults.DismissButton in this slot with onClick callback.

transformationSpec: TransformationSpec

A spec that defines how items inside the TransformingLazyColumn transform and animate as they are scrolled. It is recommended to create a spec using rememberTransformationSpec. This parameter is the key differentiator from the standard AlertDialog overload, which uses a ScalingLazyColumn without per-item customizable animations. The provided transformationSpec is automatically applied only to the dialog's standard components (title, text, and buttons), while additional items in content lambda need to be handled manually, by applying a TransformationSpec to each of them. First item has a fixed spec, with a reduced transition area, so that the top item does not appear scaled or faded when the dialog is initially displayed.

modifier: Modifier = Modifier

Modifier to be applied to the dialog content.

icon: (@Composable () -> Unit)? = null

Optional slot for an icon to be shown at the top of the dialog.

text: (@Composable () -> Unit)? = null

Optional slot for displaying the message of the dialog below the title. Should contain additional text that presents further details about the dialog's purpose if the title is insufficient.

verticalArrangement: Arrangement.Vertical = AlertDialogDefaults.VerticalArrangement

The vertical arrangement of the dialog's children. There is a default padding between icon, title, and text, which will be added to the spacing specified in this verticalArrangement parameter.

contentPadding: PaddingValues = if (icon != null) { AlertDialogDefaults.confirmDismissWithIconContentPadding() } else { AlertDialogDefaults.confirmDismissContentPadding() }

The padding to apply around the entire dialog's contents. It is recommended to use the defaults, which adjust to reduce the top padding when an icon is present.

content: (TransformingLazyColumnScope.() -> Unit)? = null

A slot for additional content, displayed within a scrollable TransformingLazyColumn. To ensure that your custom items animate consistently with the rest of the dialog, we recommend applying a TransformationSpec to each of them.