AlertDialogDefaults

object AlertDialogDefaults


Contains the default values used by AlertDialog

Summary

Public functions

Unit
@Composable
ConfirmButton(
    onClick: () -> Unit,
    modifier: Modifier,
    colors: IconButtonColors,
    content: @Composable RowScope.() -> Unit
)

Default composable for the confirm button in an AlertDialog.

Unit
@Composable
DismissButton(
    onClick: () -> Unit,
    modifier: Modifier,
    colors: IconButtonColors,
    content: @Composable RowScope.() -> Unit
)

Default composable for the dismiss button in an AlertDialog.

Unit
@Composable
EdgeButton(
    onClick: () -> Unit,
    modifier: Modifier,
    colors: ButtonColors,
    content: @Composable RowScope.() -> Unit
)

Default composable for the edge button in an AlertDialog.

Unit

Separator for the AlertDialog.

PaddingValues

The padding to apply around the content for the AlertDialog variation using TransformingLazyColumn, without an icon, and with a stack of buttons for options.

PaddingValues

The padding to apply around the content for the AlertDialog variation using TransformingLazyColumn, with icon, and with a stack of buttons for options.

PaddingValues

The padding to apply around the content for the AlertDialog variation with confirm dismiss buttons and no icon content.

PaddingValues

The padding to apply around the content for the AlertDialog variation when an icon is provided and with confirm dismiss buttons.

PaddingValues

The padding to apply around the content for the AlertDialog with either a stack of buttons (no confirm or dismiss buttons) or an EdgeButton, and when there is no icon.

PaddingValues

The padding to apply around the content for the AlertDialog with either a stack of buttons (no confirm or dismiss buttons) or an EdgeButton, and when there is an icon.

Public properties

@Composable RowScope.() -> Unit

Default icon for the confirm button.

@Composable RowScope.() -> Unit

Default icon for the dismiss button.

Arrangement.Vertical

Default vertical arrangement for an AlertDialog.

Public functions

ConfirmButton

Added in 1.5.0
@Composable
fun ConfirmButton(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    colors: IconButtonColors = IconButtonDefaults.filledIconButtonColors(),
    content: @Composable RowScope.() -> Unit = ConfirmIcon
): Unit

Default composable for the confirm button in an AlertDialog. Should be used with AlertDialog overload which has 2 button slots to confirm or dismiss the action.

Parameters
onClick: () -> Unit

The callback to be invoked when the button is clicked.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

colors: IconButtonColors = IconButtonDefaults.filledIconButtonColors()

The IconButtonColors to be used for the button.

content: @Composable RowScope.() -> Unit = ConfirmIcon

The composable content of the button. Defaults to ConfirmIcon.

DismissButton

Added in 1.5.0
@Composable
fun DismissButton(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    colors: IconButtonColors = IconButtonDefaults.filledTonalIconButtonColors(),
    content: @Composable RowScope.() -> Unit = DismissIcon
): Unit

Default composable for the dismiss button in an AlertDialog. Should be used with AlertDialog overload which has 2 button slots to confirm or dismiss the action.

Parameters
onClick: () -> Unit

The callback to be invoked when the button is clicked.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

colors: IconButtonColors = IconButtonDefaults.filledTonalIconButtonColors()

The IconButtonColors to be used for the button.

content: @Composable RowScope.() -> Unit = DismissIcon

The composable content of the button. Defaults to DismissIcon.

EdgeButton

Added in 1.5.0
@Composable
fun EdgeButton(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    colors: ButtonColors = ButtonDefaults.buttonColors(),
    content: @Composable RowScope.() -> Unit = ConfirmIcon
): Unit

Default composable for the edge button in an AlertDialog. This is a medium sized EdgeButton. Should be used with AlertDialog overload which contains a single edgeButton slot.

Parameters
onClick: () -> Unit

The callback to be invoked when the button is clicked.

modifier: Modifier = Modifier

The Modifier to be applied to the button.

colors: ButtonColors = ButtonDefaults.buttonColors()

The ButtonColors to be used for the button.

content: @Composable RowScope.() -> Unit = ConfirmIcon

The composable content of the button. Defaults to ConfirmIcon.

GroupSeparator

Added in 1.5.0
@Composable
fun GroupSeparator(): Unit

Separator for the AlertDialog. Should be used inside AlertDialog content for splitting groups of elements.

buttonStackContentPadding

Added in 1.6.0-alpha06
@Composable
fun buttonStackContentPadding(isScrollable: Boolean): PaddingValues

The padding to apply around the content for the AlertDialog variation using TransformingLazyColumn, without an icon, and with a stack of buttons for options. Bottom padding is calculated based on the provided isScrollable parameter, which favors the use of a bigger padding for scrollable content and a smaller one for fixed content.

buttonStackWithIconContentPadding

Added in 1.6.0-alpha06
@Composable
fun buttonStackWithIconContentPadding(isScrollable: Boolean): PaddingValues

The padding to apply around the content for the AlertDialog variation using TransformingLazyColumn, with icon, and with a stack of buttons for options. Bottom padding is calculated based on the provided isScrollable parameter, which favors the use of a bigger padding for scrollable content and a smaller one for fixed content.

confirmDismissContentPadding

Added in 1.5.0
@Composable
fun confirmDismissContentPadding(): PaddingValues

The padding to apply around the content for the AlertDialog variation with confirm dismiss buttons and no icon content.

confirmDismissWithIconContentPadding

Added in 1.5.0
@Composable
fun confirmDismissWithIconContentPadding(): PaddingValues

The padding to apply around the content for the AlertDialog variation when an icon is provided and with confirm dismiss buttons.

contentPadding

Added in 1.5.0
@Composable
fun contentPadding(): PaddingValues

The padding to apply around the content for the AlertDialog with either a stack of buttons (no confirm or dismiss buttons) or an EdgeButton, and when there is no icon. For the EdgeButton variation, the bottom padding is ignored.

contentWithIconPadding

Added in 1.5.0
@Composable
fun contentWithIconPadding(): PaddingValues

The padding to apply around the content for the AlertDialog with either a stack of buttons (no confirm or dismiss buttons) or an EdgeButton, and when there is an icon. For the EdgeButton variation, the bottom padding is ignored.

Public properties

ConfirmIcon

Added in 1.5.0
val ConfirmIcon: @Composable RowScope.() -> Unit

Default icon for the confirm button.

DismissIcon

Added in 1.5.0
val DismissIcon: @Composable RowScope.() -> Unit

Default icon for the dismiss button.

VerticalArrangement

Added in 1.5.0
val VerticalArrangementArrangement.Vertical

Default vertical arrangement for an AlertDialog.