Dialog

Composable Component

A base dialog component used by AlertDialog and ConfirmationDialog variations. This dialog provides a full-screen experience with custom entry/exit animations.

Android
@Composable
public fun Dialog(
    visible: Boolean,
    onDismissRequest: () -> Unit,
    modifier: Modifier = Modifier,
    properties: DialogProperties = DialogProperties(),
    content: @Composable () -> Unit,
)

Parameters

visibleA boolean value that determines whether the dialog should be displayed.
onDismissRequestA lambda function to be called when the dialog is dismissed by swiping right. Implementation of this lambda must remove the dialog from the composition hierarchy e.g. by setting visible to false.
modifierModifier to be applied to the dialog content.
propertiesAn optional DialogProperties object for configuring the dialog's behavior.
contentA composable function that defines the content of the dialog.

Create your own Component Library

Material Components are meant to be used as is and they do not allow customizations. To build your own Jetpack Compose component library use Compose Unstyled