Skip to content

Dialog

A modal that interrupts for a decision.

Dialog Dialog

var open by remember {
    mutableStateOf(
        value = false,
    )
}
JengaButton(
    text = "Dialog",
    onClick = { open = true },
    variant = JengaButtonVariant.Outline,
)
if (open) {
    JengaDialog(
        onDismissRequest = { open = false },
        title = "Reset device?",
        text = "This clears the cached gate session on this device.",
        confirmButton = {
            JengaButton(
                text = "Reset",
                onClick = { open = false },
                variant = JengaButtonVariant.Danger,
            )
        },
        dismissButton = {
            JengaButton(
                text = "Cancel",
                onClick = { open = false },
                variant = JengaButtonVariant.Ghost,
            )
        },
    )
}