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
@Composable
contentPadding(hasBottomButton: Boolean)

The padding to apply around the content.

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.

Dp

The extra top padding to apply to the edge button.

Public functions

BottomButton

Added in 1.0.0-alpha25
@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-alpha25
@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-alpha25
@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-alpha25
@Composable
fun GroupSeparator(): Unit

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

contentPadding

Added in 1.0.0-alpha25
@Composable
fun contentPadding(hasBottomButton: Boolean): PaddingValues

The padding to apply around the content. Changes based on whether the dialog has a bottom button or not.

Parameters
hasBottomButton: Boolean

A boolean indicating whether the dialog has a bottom button.

Public properties

ConfirmIcon

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

Default icon for the confirm button.

DismissIcon

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

Default icon for the dismiss button.

VerticalArrangement

Added in 1.0.0-alpha25
val VerticalArrangementArrangement.Vertical

Default vertical arrangement for an AlertDialog.

edgeButtonExtraTopPadding

Added in 1.0.0-alpha25
val edgeButtonExtraTopPaddingDp

The extra top padding to apply to the edge button.