> For the complete documentation index, see [llms.txt](https://roudi.gitbook.io/guia-navigation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://roudi.gitbook.io/guia-navigation/using-guia/the-lore/navigation-node/dialog.md).

# Dialog

A `Dialog` will be rendered inside a `Dialog` Composable.

```kotlin
class Dialog(
    override val content: @Composable () -> Unit
) : NavigationNode {
    ..
    var dialogOptions by mutableStateOf(DialogOptions())
    ..
}
```

Similar to [BottomSheet](/guia-navigation/using-guia/the-lore/navigation-node/bottom-sheet.md), a `Dialog` has stateful `DialogOptions` that can be updated at any time.

```kotlin
data class DialogOptions(
    val dismissOnClickOutside: Boolean = true,
    val dismissOnBackPress: Boolean = true,
    val securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit,
)
```

Navigating between 2 Dialogs will also animate the changes within the dialog container that hosts them.

### Updating Dialog state

Note that `DialogOptions` currently are not saved/restored so make sure you have a backing saveable state if needed in your Composable.

```kotlin
@Composable
fun MyDialog() {
    val dialog = requireLocalDialog() // Get the local dialog node
    var dismissOnBackPress by rememberSaveable { mutableStateOf(false)) }
    
    LaunchedEffect(dismissOnBackPress) {
        dialog.dialogOptions = dialog.dialogOptions.copy(
            dismissOnBackPress = dismissOnBackPress,
            dismissOnClickOutside = dismissOnBackPress
        )
    }
    
    Button(onClick = { 
        dismissOnBackPress = !dismissOnBackPress
    }) {
        Text(text = "Toggle Back Press!")
    }
}
```

<div><figure><img src="/files/62iumDuWF6Hr8CfIff4f" alt=""><figcaption></figcaption></figure> <figure><img src="/files/nuXSZ7OymMePpS7MNgwe" alt=""><figcaption></figcaption></figure></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://roudi.gitbook.io/guia-navigation/using-guia/the-lore/navigation-node/dialog.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
