<h2 id="dialog-route-arguments-deeplinks-dialogproperties-content">dialog</h2>

<div class='sourceset sourceset-common'>Common</div>

```kotlin
public fun NavGraphBuilder.dialog(
    route: String,
    arguments: List<NamedNavArgument> = emptyList(),
    deepLinks: List<NavDeepLink> = emptyList(),
    dialogProperties: DialogProperties = DialogProperties(),
    content: @Composable (NavBackStackEntry) -> Unit,
)
```

Add the [Composable](/jetpack-compose/androidx.navigation/navigation-compose/functions/composable) to the `NavGraphBuilder` that will be hosted within a
[androidx.compose.ui.window.Dialog](/jetpack-compose/androidx.navigation/navigation-compose/functions/dialog). This is suitable only when this dialog represents a separate
screen in your app that needs its own lifecycle and saved state, independent of any other
destination in your navigation graph. For use cases such as `AlertDialog`, you should use those
APIs directly in the [composable](/jetpack-compose/androidx.navigation/navigation-compose/functions/composable) destination that wants to show that dialog.

#### Parameters

| | |
| --- | --- |
| route | route for the destination |
| arguments | list of arguments to associate with destination |
| deepLinks | list of deep links to associate with the destinations |
| dialogProperties | properties that should be passed to [androidx.compose.ui.window.Dialog](/jetpack-compose/androidx.navigation/navigation-compose/functions/dialog). |
| content | composable content for the destination that will be hosted within the Dialog |

<hr class="docs-overload-divider">

<h2 id="dialog-typemap-deeplinks-dialogproperties">dialog</h2>

<div class='sourceset sourceset-common'>Common</div>

```kotlin
public inline fun <reified T : Any> NavGraphBuilder.dialog(
    typeMap: Map<KType, @JvmSuppressWildcards NavType<*>> = emptyMap(),
    deepLinks: List<NavDeepLink> = emptyList(),
    dialogProperties: DialogProperties = DialogProperties(),
    noinline content: @Composable (NavBackStackEntry) -> Unit,
)
```

Add the [Composable](/jetpack-compose/androidx.navigation/navigation-compose/functions/composable) to the `NavGraphBuilder` that will be hosted within a
[androidx.compose.ui.window.Dialog](/jetpack-compose/androidx.navigation/navigation-compose/functions/dialog). This is suitable only when this dialog represents a separate
screen in your app that needs its own lifecycle and saved state, independent of any other
destination in your navigation graph. For use cases such as `AlertDialog`, you should use those
APIs directly in the [composable](/jetpack-compose/androidx.navigation/navigation-compose/functions/composable) destination that wants to show that dialog.

#### Parameters

| | |
| --- | --- |
| T | route from a KClass for the destination |
| typeMap | map of destination arguments' kotlin type `KType` to its respective custom `NavType`. May be empty if `T` does not use custom NavTypes. |
| deepLinks | list of deep links to associate with the destinations |
| dialogProperties | properties that should be passed to [androidx.compose.ui.window.Dialog](/jetpack-compose/androidx.navigation/navigation-compose/functions/dialog). |
| content | composable content for the destination that will be hosted within the Dialog |

<hr class="docs-overload-divider">

<h2 id="dialog-route-typemap-deeplinks-dialogproperties-content">dialog</h2>

<div class='sourceset sourceset-common'>Common</div>

```kotlin
public fun <T : Any> NavGraphBuilder.dialog(
    route: KClass<T>,
    typeMap: Map<KType, @JvmSuppressWildcards NavType<*>> = emptyMap(),
    deepLinks: List<NavDeepLink> = emptyList(),
    dialogProperties: DialogProperties = DialogProperties(),
    content: @Composable (NavBackStackEntry) -> Unit,
)
```

Add the [Composable](/jetpack-compose/androidx.navigation/navigation-compose/functions/composable) to the `NavGraphBuilder` that will be hosted within a
[androidx.compose.ui.window.Dialog](/jetpack-compose/androidx.navigation/navigation-compose/functions/dialog). This is suitable only when this dialog represents a separate
screen in your app that needs its own lifecycle and saved state, independent of any other
destination in your navigation graph. For use cases such as `AlertDialog`, you should use those
APIs directly in the [composable](/jetpack-compose/androidx.navigation/navigation-compose/functions/composable) destination that wants to show that dialog.

#### Parameters

| | |
| --- | --- |
| route | route from `KClass` of `T` for the destination |
| typeMap | map of destination arguments' kotlin type `KType` to its respective custom `NavType`. May be empty if `route` does not use custom NavTypes. |
| deepLinks | list of deep links to associate with the destinations |
| dialogProperties | properties that should be passed to [androidx.compose.ui.window.Dialog](/jetpack-compose/androidx.navigation/navigation-compose/functions/dialog). |
| content | composable content for the destination that will be hosted within the Dialog |