AlertDialogDefaults

object AlertDialogDefaults


Contains the default values used by AlertDialog

Summary

Public functions

Unit
@Composable
ConfirmButton(onClick: () -> Unit, content: @Composable RowScope.() -> Unit)

Default composable for the confirm button in an AlertDialog.

Unit
@Composable
DismissButton(onClick: () -> Unit, content: @Composable RowScope.() -> Unit)

Default composable for the dismiss button in an AlertDialog.

Unit
@Composable
EdgeButton(
    onClick: () -> Unit,
    modifier: Modifier,
    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-alpha27
@Composable
fun ConfirmButton(
    onClick: () -> Unit,
    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.

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

The composable content of the button. Defaults to ConfirmIcon.

DismissButton

Added in 1.0.0-alpha27
@Composable
fun DismissButton(
    onClick: () -> Unit,
    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.

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

The composable content of the button. Defaults to DismissIcon.

EdgeButton

Added in 1.0.0-alpha27
@Composable
fun EdgeButton(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    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.

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

The composable content of the button. Defaults to ConfirmIcon.

GroupSeparator

Added in 1.0.0-alpha27
@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-alpha27
@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-alpha27
@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

Added in 1.0.0-alpha27
@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-alpha27
val ConfirmIcon: @Composable RowScope.() -> Unit

Default icon for the confirm button.

DismissIcon

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

Default icon for the dismiss button.

VerticalArrangement

Added in 1.0.0-alpha27
val VerticalArrangementArrangement.Vertical

Default vertical arrangement for an AlertDialog.