State of Compose 2023 results are in! Click here to learn more

← Back to Foundation

Dialog

Component
in
Foundation
. Since 0.1.0-dev15

Overview

Code Examples

Video

Opens a dialog with the given content.

The dialog is visible as long as it is part of the composition hierarchy. In order to let the user dismiss the Dialog, the implementation of onCloseRequest should contain a way to remove to remove the dialog from the composition hierarchy.

Overloads

Dialog

@Composable
actual fun Dialog(onCloseRequest: () -> Unit, children: @Composable () -> Unit)

Parameters

NameDescription
onCloseRequestExecutes when the user tries to dismiss the Dialog.
childrenThe content to be displayed inside the dialog