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 with confirm dismiss buttons.

PaddingValues

The padding to apply around the content for the AlertDialog variation with a stack of options and no buttons at the end.

PaddingValues

The padding to apply around the content for the AlertDialog variation with a bottom button.

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.0.0-alpha30
@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.0.0-alpha30
@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.0.0-alpha30
@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.0.0-alpha30
@Composable
fun GroupSeparator(): Unit

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

confirmDismissContentPadding

Added in 1.0.0-alpha30
@Composable
fun confirmDismissContentPadding(): PaddingValues

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

contentPadding

Added in 1.0.0-alpha30
@Composable
fun contentPadding(): PaddingValues

The padding to apply around the content for the AlertDialog variation with a stack of options and no buttons at the end.

contentPaddingWithEdgeButton

@Composable
fun contentPaddingWithEdgeButton(
    edgeButtonSize: EdgeButtonSize = EdgeButtonSize.Medium
): PaddingValues

The padding to apply around the content for the AlertDialog variation with a bottom button. If you need to configure custom paddings, consider using ScreenScaffoldDefaults.contentPaddingWithEdgeButton

Public properties

ConfirmIcon

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

Default icon for the confirm button.

DismissIcon

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

Default icon for the dismiss button.

VerticalArrangement

Added in 1.0.0-alpha30
val VerticalArrangementArrangement.Vertical

Default vertical arrangement for an AlertDialog.