# NavGraphBuilderKt

Added in 2.4.0

*** ** * ** ***


```
public final class NavGraphBuilderKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final void` | `[navigation](https://developer.android.com/reference/androidx/navigation/NavGraphBuilderKt#(androidx.navigation.NavGraphBuilder).navigation(kotlin.Int,kotlin.Int,kotlin.Function1))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder receiver, @https://developer.android.com/reference/androidx/annotation/IdRes int id, @https://developer.android.com/reference/androidx/annotation/IdRes int startDestination, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` **This method is deprecated.** Use routes to build your nested NavGraph instead |
| `static final void` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/navigation/NavGraphBuilderKt#(androidx.navigation.NavGraphBuilder).navigation(kotlin.Any,kotlin.collections.Map,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html startDestination, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` Construct a nested `https://developer.android.com/reference/androidx/navigation/NavGraph` |
| `static final void` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/navigation/NavGraphBuilderKt#(androidx.navigation.NavGraphBuilder).navigation(kotlin.reflect.KClass,kotlin.collections.Map,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> startDestination, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` Construct a nested `https://developer.android.com/reference/androidx/navigation/NavGraph` |
| `static final void` | `https://developer.android.com/reference/androidx/navigation/NavGraphBuilderKt#(androidx.navigation.NavGraphBuilder).navigation(kotlin.String,kotlin.String,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html startDestination, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html route, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` Construct a nested `https://developer.android.com/reference/androidx/navigation/NavGraph` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraph` | `[navigation](https://developer.android.com/reference/androidx/navigation/NavGraphBuilderKt#(androidx.navigation.NavigatorProvider).navigation(kotlin.Int,kotlin.Int,kotlin.Function1))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavigatorProvider receiver, @https://developer.android.com/reference/androidx/annotation/IdRes int id, @https://developer.android.com/reference/androidx/annotation/IdRes int startDestination, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` **This method is deprecated.** Use routes to build your NavGraph instead |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraph` | `https://developer.android.com/reference/androidx/navigation/NavGraphBuilderKt#(androidx.navigation.NavigatorProvider).navigation(kotlin.String,kotlin.String,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavigatorProvider receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html startDestination, https://developer.android.com/reference/java/lang/String.html route, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` Construct a new `https://developer.android.com/reference/androidx/navigation/NavGraph` |
| `static final void` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/navigation/NavGraphBuilderKt#(androidx.navigation.NavGraphBuilder).navigation(kotlin.reflect.KClass,kotlin.Any,kotlin.collections.Map,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> route, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html startDestination, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` Construct a nested `https://developer.android.com/reference/androidx/navigation/NavGraph` |
| `static final void` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/navigation/NavGraphBuilderKt#(androidx.navigation.NavGraphBuilder).navigation(kotlin.reflect.KClass,kotlin.reflect.KClass,kotlin.collections.Map,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> route, @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> startDestination, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` Construct a nested `https://developer.android.com/reference/androidx/navigation/NavGraph` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraph` | `https://developer.android.com/reference/androidx/navigation/NavGraphBuilderKt#(androidx.navigation.NavigatorProvider).navigation(kotlin.Any,kotlin.reflect.KClass,kotlin.collections.Map,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavigatorProvider receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html startDestination, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> route, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` Construct a new `https://developer.android.com/reference/androidx/navigation/NavGraph` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraph` | `https://developer.android.com/reference/androidx/navigation/NavGraphBuilderKt#(androidx.navigation.NavigatorProvider).navigation(kotlin.reflect.KClass,kotlin.reflect.KClass,kotlin.collections.Map,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavigatorProvider receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> startDestination, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> route, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder )` Construct a new `https://developer.android.com/reference/androidx/navigation/NavGraph` |

## Public methods

### navigation

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavGraphBuilder.android.kt+function:navigation) Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0) Deprecated in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public static final void [navigation](https://developer.android.com/reference/androidx/navigation/NavGraphBuilderKt#(androidx.navigation.NavGraphBuilder).navigation(kotlin.Int,kotlin.Int,kotlin.Function1))(
    @NonNull NavGraphBuilder receiver,
    @IdRes int id,
    @IdRes int startDestination,
    @NonNull Function1<@NonNull NavGraphBuilder, Unit> builder
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Use routes to build your nested NavGraph instead, use this instead:
>
> ```
> navigation(startDestination = startDestination.toString(), route = id.toString()) { builder.invoke() }
> ```

Construct a nested `https://developer.android.com/reference/androidx/navigation/NavGraph`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IdRes int id` | the destination's unique id |
| `@https://developer.android.com/reference/androidx/annotation/IdRes int startDestination` | the starting destination for this NavGraph |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the graph |

| Returns |
|---|---|
| `void` | the newly constructed nested NavGraph |

### navigation

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavGraphBuilder.kt+function:navigation)

```
public static final void <T extends Object> navigation(
    @NonNull NavGraphBuilder receiver,
    @NonNull Object startDestination,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap,
    @NonNull Function1<@NonNull NavGraphBuilder, Unit> builder
)
```

Construct a nested `https://developer.android.com/reference/androidx/navigation/NavGraph`

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/java/lang/Object.html>` | the graph's unique route from a KClass |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html startDestination` | the starting destination's route from an Object for this NavGraph. The respective NavDestination must be added with route from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` in order to match. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap` | A mapping of KType to custom NavType\<\*\> in the `https://developer.android.com/reference/androidx/navigation/package-summary#(androidx.navigation.NavGraphBuilder).navigation(kotlin.Any,kotlin.collections.Map,kotlin.Function1)`. May be empty if `https://developer.android.com/reference/androidx/navigation/package-summary#(androidx.navigation.NavGraphBuilder).navigation(kotlin.Any,kotlin.collections.Map,kotlin.Function1)` does not use custom NavTypes. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the graph |

| Returns |
|---|---|
| `void` | the newly constructed nested NavGraph |

### navigation

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavGraphBuilder.kt+function:navigation)

```
public static final void <T extends Object> navigation(
    @NonNull NavGraphBuilder receiver,
    @NonNull KClass<@NonNull ?> startDestination,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap,
    @NonNull Function1<@NonNull NavGraphBuilder, Unit> builder
)
```

Construct a nested `https://developer.android.com/reference/androidx/navigation/NavGraph`

| Parameters |
|---|---|
| `<T extends https://developer.android.com/reference/java/lang/Object.html>` | the graph's unique route from a KClass |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> startDestination` | the starting destination's route from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` for this NavGraph. The respective NavDestination must be added with route from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` in order to match. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap` | A mapping of KType to custom NavType\<\*\> in the `https://developer.android.com/reference/androidx/navigation/package-summary#(androidx.navigation.NavGraphBuilder).navigation(kotlin.reflect.KClass,kotlin.collections.Map,kotlin.Function1)`. May be empty if `https://developer.android.com/reference/androidx/navigation/package-summary#(androidx.navigation.NavGraphBuilder).navigation(kotlin.reflect.KClass,kotlin.collections.Map,kotlin.Function1)` does not use custom NavTypes. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the graph |

| Returns |
|---|---|
| `void` | the newly constructed nested NavGraph |

### navigation

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavGraphBuilder.kt+function:navigation) Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public static final void navigation(
    @NonNull NavGraphBuilder receiver,
    @NonNull String startDestination,
    @NonNull String route,
    @NonNull Function1<@NonNull NavGraphBuilder, Unit> builder
)
```

Construct a nested `https://developer.android.com/reference/androidx/navigation/NavGraph`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html startDestination` | the starting destination's route for this NavGraph |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html route` | the destination's unique route |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the graph |

| Returns |
|---|---|
| `void` | the newly constructed nested NavGraph |

### navigation

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavGraphBuilder.android.kt+function:navigation) Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0) Deprecated in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public static final @NonNull NavGraph [navigation](https://developer.android.com/reference/androidx/navigation/NavGraphBuilderKt#(androidx.navigation.NavigatorProvider).navigation(kotlin.Int,kotlin.Int,kotlin.Function1))(
    @NonNull NavigatorProvider receiver,
    @IdRes int id,
    @IdRes int startDestination,
    @NonNull Function1<@NonNull NavGraphBuilder, Unit> builder
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Use routes to build your NavGraph instead, use this instead:
>
> ```
> navigation(startDestination = startDestination.toString(), route = id.toString()) { builder.invoke() }
> ```

Construct a new `https://developer.android.com/reference/androidx/navigation/NavGraph`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IdRes int id` | the destination's unique id |
| `@https://developer.android.com/reference/androidx/annotation/IdRes int startDestination` | the starting destination for this NavGraph |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the graph |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraph` | the newly constructed NavGraph |

### navigation

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavGraphBuilder.kt+function:navigation) Added in [2.4.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0)

```
public static final @NonNull NavGraph navigation(
    @NonNull NavigatorProvider receiver,
    @NonNull String startDestination,
    String route,
    @NonNull Function1<@NonNull NavGraphBuilder, Unit> builder
)
```

Construct a new `https://developer.android.com/reference/androidx/navigation/NavGraph`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html startDestination` | the starting destination's route for this NavGraph |
| `https://developer.android.com/reference/java/lang/String.html route` | the destination's unique route |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the graph |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraph` | the newly constructed NavGraph |

### navigation

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavGraphBuilder.kt+function:navigation) Added in [2.9.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.9.0)

```
public static final void <T extends Object> navigation(
    @NonNull NavGraphBuilder receiver,
    @NonNull KClass<@NonNull T> route,
    @NonNull Object startDestination,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap,
    @NonNull Function1<@NonNull NavGraphBuilder, Unit> builder
)
```

Construct a nested `https://developer.android.com/reference/androidx/navigation/NavGraph`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> route` | the graph's unique route from a KClass |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html startDestination` | the starting destination's route from an Object for this NavGraph. The respective NavDestination must be added with route from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` in order to match. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap` | A mapping of KType to custom NavType\<\*\> in the `https://developer.android.com/reference/androidx/navigation/package-summary#(androidx.navigation.NavGraphBuilder).navigation(kotlin.reflect.KClass,kotlin.Any,kotlin.collections.Map,kotlin.Function1)`. May be empty if `https://developer.android.com/reference/androidx/navigation/package-summary#(androidx.navigation.NavGraphBuilder).navigation(kotlin.reflect.KClass,kotlin.Any,kotlin.collections.Map,kotlin.Function1)` does not use custom NavTypes. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the graph |

| Returns |
|---|---|
| `void` | the newly constructed nested NavGraph |

### navigation

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavGraphBuilder.kt+function:navigation) Added in [2.9.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.9.0)

```
public static final void <T extends Object> navigation(
    @NonNull NavGraphBuilder receiver,
    @NonNull KClass<@NonNull T> route,
    @NonNull KClass<@NonNull ?> startDestination,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap,
    @NonNull Function1<@NonNull NavGraphBuilder, Unit> builder
)
```

Construct a nested `https://developer.android.com/reference/androidx/navigation/NavGraph`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> route` | the graph's unique route from KClass |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> startDestination` | the starting destination's route from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` for this NavGraph. The respective NavDestination must be added with route from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` in order to match. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap` | A mapping of KType to custom NavType\<\*\> in the `https://developer.android.com/reference/androidx/navigation/package-summary#(androidx.navigation.NavGraphBuilder).navigation(kotlin.reflect.KClass,kotlin.reflect.KClass,kotlin.collections.Map,kotlin.Function1)`. May be empty if `https://developer.android.com/reference/androidx/navigation/package-summary#(androidx.navigation.NavGraphBuilder).navigation(kotlin.reflect.KClass,kotlin.reflect.KClass,kotlin.collections.Map,kotlin.Function1)` does not use custom NavTypes. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the graph |

| Returns |
|---|---|
| `void` | the newly constructed nested NavGraph |

### navigation

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavGraphBuilder.kt+function:navigation) Added in [2.8.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.8.0)

```
public static final @NonNull NavGraph navigation(
    @NonNull NavigatorProvider receiver,
    @NonNull Object startDestination,
    KClass<@NonNull ?> route,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap,
    @NonNull Function1<@NonNull NavGraphBuilder, Unit> builder
)
```

Construct a new `https://developer.android.com/reference/androidx/navigation/NavGraph`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Object.html startDestination` | the starting destination's route from an Object for this NavGraph. The respective NavDestination must be added with route from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` in order to match. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> route` | the graph's unique route as a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap` | A mapping of KType to custom NavType\<\*\> in the `https://developer.android.com/reference/androidx/navigation/package-summary#(androidx.navigation.NavigatorProvider).navigation(kotlin.Any,kotlin.reflect.KClass,kotlin.collections.Map,kotlin.Function1)`. May be empty if `https://developer.android.com/reference/androidx/navigation/package-summary#(androidx.navigation.NavigatorProvider).navigation(kotlin.Any,kotlin.reflect.KClass,kotlin.collections.Map,kotlin.Function1)` does not use custom NavTypes. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the graph |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraph` | the newly constructed NavGraph |

### navigation

Artifact: [androidx.navigation:navigation-common](https://developer.android.com/jetpack/androidx/releases/navigation) [View Source](https://cs.android.com/search?q=file:androidx/navigation/NavGraphBuilder.kt+function:navigation) Added in [2.8.0](https://developer.android.com/jetpack/androidx/releases/navigation#2.8.0)

```
public static final @NonNull NavGraph navigation(
    @NonNull NavigatorProvider receiver,
    @NonNull KClass<@NonNull ?> startDestination,
    KClass<@NonNull ?> route,
    @NonNull Map<@NonNull KType, @NonNull NavType<@NonNull ?>> typeMap,
    @NonNull Function1<@NonNull NavGraphBuilder, Unit> builder
)
```

Construct a new `https://developer.android.com/reference/androidx/navigation/NavGraph`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> startDestination` | the starting destination's route from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` for this NavGraph. The respective NavDestination must be added with route from a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` in order to match. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> route` | the graph's unique route as a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-type/index.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavType<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> typeMap` | A mapping of KType to custom NavType\<\*\> in the `https://developer.android.com/reference/androidx/navigation/package-summary#(androidx.navigation.NavigatorProvider).navigation(kotlin.reflect.KClass,kotlin.reflect.KClass,kotlin.collections.Map,kotlin.Function1)`. May be empty if `https://developer.android.com/reference/androidx/navigation/package-summary#(androidx.navigation.NavigatorProvider).navigation(kotlin.reflect.KClass,kotlin.reflect.KClass,kotlin.collections.Map,kotlin.Function1)` does not use custom NavTypes. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraphBuilder, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> builder` | the builder used to construct the graph |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/navigation/NavGraph` | the newly constructed NavGraph |