AlertDialogDefaults

object AlertDialogDefaults


Contains the default values used by AlertDialog

Summary

Public functions

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

Default composable for the bottom button in an AlertDialog.

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

Separator for the AlertDialog.

PaddingValues

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

PaddingValues
@Composable
contentPadding(hasBottomButton: Boolean)

The padding to apply around the content for the AlertDialog variation with a stack of options and optional 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

BottomButton

Added in 1.0.0-alpha26
@Composable
fun BottomButton(onClick: () -> Unit, content: @Composable RowScope.() -> Unit = ConfirmIcon): Unit

Default composable for the bottom button in an AlertDialog. Should be used with AlertDialog overload which contains a single bottomButton slot.

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.

ConfirmButton

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

GroupSeparator

Added in 1.0.0-alpha26
@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-alpha26
@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-alpha26
@Composable
fun contentPadding(hasBottomButton: Boolean): PaddingValues

The padding to apply around the content for the AlertDialog variation with a stack of options and optional bottom button.

Public properties

ConfirmIcon

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

Default icon for the confirm button.

DismissIcon

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

Default icon for the dismiss button.

VerticalArrangement

Added in 1.0.0-alpha26
val VerticalArrangementArrangement.Vertical

Default vertical arrangement for an AlertDialog.