androidx.navigation.compose

Classes

ComposeNavigator

Navigator that navigates through Composables.

ComposeNavigator.Destination

NavDestination specific to ComposeNavigator

ComposeNavigatorDestinationBuilder

DSL for constructing a new ComposeNavigator.Destination

DialogNavigator

Navigator that navigates through Composables that will be hosted within a Dialog.

DialogNavigator.Destination

NavDestination specific to DialogNavigator

DialogNavigatorDestinationBuilder

DSL for constructing a new DialogNavigator.Destination

Top-level functions summary

Unit

Show each Destination on the DialogNavigator's back stack as a Dialog.

Unit

Provides a place in the Compose hierarchy for self contained navigation to occur.

Unit
@Composable
NavHost(
    navController: <Error class: unknown class>,
    startDestination: String,
    modifier: Modifier,
    contentAlignment: Alignment,
    route: String?,
    enterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition,
    exitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition,
    popEnterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition,
    popExitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)?,
    builder: <Error class: unknown class>.() -> Unit
)

Provides a place in the Compose hierarchy for self contained navigation to occur.

Unit
@Composable
NavHost(
    navController: <Error class: unknown class>,
    startDestination: Any,
    modifier: Modifier,
    contentAlignment: Alignment,
    route: KClass<*>?,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>>,
    enterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition,
    exitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition,
    popEnterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition,
    popExitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)?,
    builder: <Error class: unknown class>.() -> Unit
)

Provides in place in the Compose hierarchy for self contained navigation to occur.

Unit
@Composable
NavHost(
    navController: <Error class: unknown class>,
    startDestination: KClass<*>,
    modifier: Modifier,
    contentAlignment: Alignment,
    route: KClass<*>?,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>>,
    enterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition,
    exitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition,
    popEnterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition,
    popExitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)?,
    builder: <Error class: unknown class>.() -> Unit
)

Provides a place in the Compose hierarchy for self contained navigation to occur.

<Error class: unknown class>

Creates a NavHostController that handles the adding of the ComposeNavigator and DialogNavigator.

Extension functions summary

Unit
@Composable
<Error class: unknown class>.LocalOwnersProvider(
    saveableStateHolder: SaveableStateHolder,
    content: @Composable () -> Unit
)

Provides NavBackStackEntry as LocalViewModelStoreOwner, LocalLifecycleOwner and LocalSavedStateRegistryOwner to the content and saves the content's saveable states with the given saveableStateHolder.

inline Unit
<T : Any> <Error class: unknown class>.composable(
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>>,
    deepLinks: List<<Error class: unknown class>>,
    noinline enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    noinline exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    noinline popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    noinline popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    noinline sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)?,
    noinline content: @Composable AnimatedContentScope.(<Error class: unknown class>) -> Unit
)

Add the Composable to the NavGraphBuilder

Unit
<T : Any> <Error class: unknown class>.composable(
    route: KClass<T>,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>>,
    deepLinks: List<<Error class: unknown class>>,
    enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)?,
    content: @Composable AnimatedContentScope.(<Error class: unknown class>) -> Unit
)

Add the Composable to the NavGraphBuilder

Unit
<Error class: unknown class>.composable(
    route: String,
    arguments: List<<Error class: unknown class>>,
    deepLinks: List<<Error class: unknown class>>,
    enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)?,
    content: @Composable AnimatedContentScope.(<Error class: unknown class>) -> Unit
)

Add the Composable to the NavGraphBuilder

State<<Error class: unknown class>?>

Gets the current navigation back stack entry as a MutableState.

inline Unit

Add the Composable to the NavGraphBuilder that will be hosted within a androidx.compose.ui.window.Dialog.

Unit
<T : Any> <Error class: unknown class>.dialog(
    route: KClass<T>,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>>,
    deepLinks: List<<Error class: unknown class>>,
    dialogProperties: DialogProperties,
    content: @Composable (<Error class: unknown class>) -> Unit
)

Add the Composable to the NavGraphBuilder that will be hosted within a androidx.compose.ui.window.Dialog.

Unit
<Error class: unknown class>.dialog(
    route: String,
    arguments: List<<Error class: unknown class>>,
    deepLinks: List<<Error class: unknown class>>,
    dialogProperties: DialogProperties,
    content: @Composable (<Error class: unknown class>) -> Unit
)

Add the Composable to the NavGraphBuilder that will be hosted within a androidx.compose.ui.window.Dialog.

inline Unit
<T : Any> <Error class: unknown class>.navigation(
    startDestination: Any,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>>,
    deepLinks: List<<Error class: unknown class>>,
    noinline enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    noinline exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    noinline popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    noinline popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    noinline sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)?,
    noinline builder: <Error class: unknown class>.() -> Unit
)

Construct a nested NavGraph

inline Unit
<T : Any> <Error class: unknown class>.navigation(
    startDestination: KClass<*>,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>>,
    deepLinks: List<<Error class: unknown class>>,
    noinline enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    noinline exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    noinline popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    noinline popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    noinline sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)?,
    noinline builder: <Error class: unknown class>.() -> Unit
)

Construct a nested NavGraph

Unit
<T : Any> <Error class: unknown class>.navigation(
    startDestination: Any,
    route: KClass<T>,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>>,
    deepLinks: List<<Error class: unknown class>>,
    enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)?,
    builder: <Error class: unknown class>.() -> Unit
)

Construct a nested NavGraph

Unit
<T : Any> <Error class: unknown class>.navigation(
    startDestination: KClass<*>,
    route: KClass<T>,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>>,
    deepLinks: List<<Error class: unknown class>>,
    enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)?,
    builder: <Error class: unknown class>.() -> Unit
)

Construct a nested NavGraph

Unit
<Error class: unknown class>.navigation(
    startDestination: String,
    route: String,
    arguments: List<<Error class: unknown class>>,
    deepLinks: List<<Error class: unknown class>>,
    enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)?,
    popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)?,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)?,
    builder: <Error class: unknown class>.() -> Unit
)

Construct a nested NavGraph

Top-level functions

@Composable
fun DialogHost(dialogNavigator: DialogNavigator): Unit

Show each Destination on the DialogNavigator's back stack as a Dialog.

Note that NavHost will call this for you; you do not need to call it manually.

@Composable
fun NavHost(
    navController: <Error class: unknown class>,
    graph: <Error class: unknown class>,
    modifier: Modifier = Modifier,
    contentAlignment: Alignment = Alignment.TopStart,
    enterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) },
    exitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) },
    popEnterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = enterTransition,
    popExitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = exitTransition,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null
): Unit

Provides a place in the Compose hierarchy for self contained navigation to occur.

Once this is called, any Composable within the given NavGraphBuilder can be navigated to from the provided navController.

Parameters
navController: <Error class: unknown class>

the navController for this host

graph: <Error class: unknown class>

the graph for this host

modifier: Modifier = Modifier

The modifier to be applied to the layout.

contentAlignment: Alignment = Alignment.TopStart

The Alignment of the AnimatedContent

enterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) }

callback to define enter transitions for destination in this host

exitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) }

callback to define exit transitions for destination in this host

popEnterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = enterTransition

callback to define popEnter transitions for destination in this host

popExitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = exitTransition

callback to define popExit transitions for destination in this host

sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null

callback to define the size transform for destinations in this host

@Composable
fun NavHost(
    navController: <Error class: unknown class>,
    startDestination: String,
    modifier: Modifier = Modifier,
    contentAlignment: Alignment = Alignment.TopStart,
    route: String? = null,
    enterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) },
    exitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) },
    popEnterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = enterTransition,
    popExitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = exitTransition,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null,
    builder: <Error class: unknown class>.() -> Unit
): Unit

Provides a place in the Compose hierarchy for self contained navigation to occur.

Once this is called, any Composable within the given NavGraphBuilder can be navigated to from the provided navController.

The builder passed into this method is remembered. This means that for this NavHost, the contents of the builder cannot be changed.

Parameters
navController: <Error class: unknown class>

the navController for this host

startDestination: String

the route for the start destination

modifier: Modifier = Modifier

The modifier to be applied to the layout.

contentAlignment: Alignment = Alignment.TopStart

The Alignment of the AnimatedContent

route: String? = null

the route for the graph

enterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) }

callback to define enter transitions for destination in this host

exitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) }

callback to define exit transitions for destination in this host

popEnterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = enterTransition

callback to define popEnter transitions for destination in this host

popExitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = exitTransition

callback to define popExit transitions for destination in this host

sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null

callback to define the size transform for destinations in this host

builder: <Error class: unknown class>.() -> Unit

the builder used to construct the graph

@Composable
fun NavHost(
    navController: <Error class: unknown class>,
    startDestination: Any,
    modifier: Modifier = Modifier,
    contentAlignment: Alignment = Alignment.TopStart,
    route: KClass<*>? = null,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap(),
    enterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) },
    exitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) },
    popEnterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = enterTransition,
    popExitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = exitTransition,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null,
    builder: <Error class: unknown class>.() -> Unit
): Unit

Provides in place in the Compose hierarchy for self contained navigation to occur.

Once this is called, any Composable within the given NavGraphBuilder can be navigated to from the provided navController.

The builder passed into this method is remembered. This means that for this NavHost, the contents of the builder cannot be changed.

Parameters
navController: <Error class: unknown class>

the navController for this host

startDestination: Any

the route from a an Object for the start destination

modifier: Modifier = Modifier

The modifier to be applied to the layout.

contentAlignment: Alignment = Alignment.TopStart

The Alignment of the AnimatedContent

route: KClass<*>? = null

the route from a KClass for the graph

typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap()

map of destination arguments' kotlin type KType to its respective custom NavType. May be empty if route does not use custom NavTypes.

enterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) }

callback to define enter transitions for destination in this host

exitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) }

callback to define exit transitions for destination in this host

popEnterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = enterTransition

callback to define popEnter transitions for destination in this host

popExitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = exitTransition

callback to define popExit transitions for destination in this host

sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null

callback to define the size transform for destinations in this host

builder: <Error class: unknown class>.() -> Unit

the builder used to construct the graph

@Composable
fun NavHost(
    navController: <Error class: unknown class>,
    startDestination: KClass<*>,
    modifier: Modifier = Modifier,
    contentAlignment: Alignment = Alignment.TopStart,
    route: KClass<*>? = null,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap(),
    enterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) },
    exitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) },
    popEnterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = enterTransition,
    popExitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = exitTransition,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null,
    builder: <Error class: unknown class>.() -> Unit
): Unit

Provides a place in the Compose hierarchy for self contained navigation to occur.

Once this is called, any Composable within the given NavGraphBuilder can be navigated to from the provided navController.

The builder passed into this method is remembered. This means that for this NavHost, the contents of the builder cannot be changed.

Parameters
navController: <Error class: unknown class>

the navController for this host

startDestination: KClass<*>

the route from a KClass for the start destination

modifier: Modifier = Modifier

The modifier to be applied to the layout.

contentAlignment: Alignment = Alignment.TopStart

The Alignment of the AnimatedContent

route: KClass<*>? = null

the route from a KClass for the graph

typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap()

map of destination arguments' kotlin type KType to its respective custom NavType. May be empty if route does not use custom NavTypes.

enterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) }

callback to define enter transitions for destination in this host

exitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) }

callback to define exit transitions for destination in this host

popEnterTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition = enterTransition

callback to define popEnter transitions for destination in this host

popExitTransition: AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition = exitTransition

callback to define popExit transitions for destination in this host

sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null

callback to define the size transform for destinations in this host

builder: <Error class: unknown class>.() -> Unit

the builder used to construct the graph

rememberNavController

@Composable
fun rememberNavController(
    vararg navigators: <Error class: unknown class><<Error class: unknown class>>
): <Error class: unknown class>

Creates a NavHostController that handles the adding of the ComposeNavigator and DialogNavigator. Additional Navigator instances can be passed through navigators to be applied to the returned NavController. Note that each Navigator must be separately remembered before being passed in here: any changes to those inputs will cause the NavController to be recreated.

See also
NavHost

Extension functions

@Composable
fun <Error class: unknown class>.LocalOwnersProvider(
    saveableStateHolder: SaveableStateHolder,
    content: @Composable () -> Unit
): Unit

Provides NavBackStackEntry as LocalViewModelStoreOwner, LocalLifecycleOwner and LocalSavedStateRegistryOwner to the content and saves the content's saveable states with the given saveableStateHolder.

Parameters
saveableStateHolder: SaveableStateHolder

The SaveableStateHolder that holds the saved states. The same holder should be used for all NavBackStackEntrys in the encapsulating Composable and the holder should be hoisted.

content: @Composable () -> Unit

The content Composable

inline fun <T : Any> <Error class: unknown class>.composable(
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap(),
    deepLinks: List<<Error class: unknown class>> = emptyList(),
    noinline enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null,
    noinline exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null,
    noinline popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition,
    noinline popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition,
    noinline sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null,
    noinline content: @Composable AnimatedContentScope.(<Error class: unknown class>) -> Unit
): Unit

Add the Composable to the NavGraphBuilder

Parameters
<T : Any>

route from a KClass for the destination

typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap()

map of destination arguments' kotlin type KType to its respective custom NavType. May be empty if T does not use custom NavTypes.

deepLinks: List<<Error class: unknown class>> = emptyList()

list of deep links to associate with the destinations

noinline enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null

callback to determine the destination's enter transition

noinline exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null

callback to determine the destination's exit transition

noinline popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition

callback to determine the destination's popEnter transition

noinline popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition

callback to determine the destination's popExit transition

noinline sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null

callback to determine the destination's sizeTransform.

noinline content: @Composable AnimatedContentScope.(<Error class: unknown class>) -> Unit

composable for the destination

fun <T : Any> <Error class: unknown class>.composable(
    route: KClass<T>,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap(),
    deepLinks: List<<Error class: unknown class>> = emptyList(),
    enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null,
    exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null,
    popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition,
    popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null,
    content: @Composable AnimatedContentScope.(<Error class: unknown class>) -> Unit
): Unit

Add the Composable to the NavGraphBuilder

Parameters
route: KClass<T>

route from a KClass for the destination

typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap()

map of destination arguments' kotlin type KType to its respective custom NavType. May be empty if route does not use custom NavTypes.

deepLinks: List<<Error class: unknown class>> = emptyList()

list of deep links to associate with the destinations

enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null

callback to determine the destination's enter transition

exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null

callback to determine the destination's exit transition

popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition

callback to determine the destination's popEnter transition

popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition

callback to determine the destination's popExit transition

sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null

callback to determine the destination's sizeTransform.

content: @Composable AnimatedContentScope.(<Error class: unknown class>) -> Unit

composable for the destination

fun <Error class: unknown class>.composable(
    route: String,
    arguments: List<<Error class: unknown class>> = emptyList(),
    deepLinks: List<<Error class: unknown class>> = emptyList(),
    enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null,
    exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null,
    popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition,
    popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null,
    content: @Composable AnimatedContentScope.(<Error class: unknown class>) -> Unit
): Unit

Add the Composable to the NavGraphBuilder

Parameters
route: String

route for the destination

arguments: List<<Error class: unknown class>> = emptyList()

list of arguments to associate with destination

deepLinks: List<<Error class: unknown class>> = emptyList()

list of deep links to associate with the destinations

enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null

callback to determine the destination's enter transition

exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null

callback to determine the destination's exit transition

popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition

callback to determine the destination's popEnter transition

popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition

callback to determine the destination's popExit transition

sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null

callback to determine the destination's sizeTransform.

content: @Composable AnimatedContentScope.(<Error class: unknown class>) -> Unit

composable for the destination

@Composable
fun <Error class: unknown class>.currentBackStackEntryAsState(): State<<Error class: unknown class>?>

Gets the current navigation back stack entry as a MutableState. When the given navController changes the back stack due to a NavController.navigate or NavController.popBackStack this will trigger a recompose and return the top entry on the back stack.

Returns
State<<Error class: unknown class>?>

a mutable state of the current back stack entry

inline fun <T : Any> <Error class: unknown class>.dialog(
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap(),
    deepLinks: List<<Error class: unknown class>> = emptyList(),
    dialogProperties: DialogProperties = DialogProperties(),
    noinline content: @Composable (<Error class: unknown class>) -> Unit
): Unit

Add the Composable to the NavGraphBuilder that will be hosted within a androidx.compose.ui.window.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 destination that wants to show that dialog.

Parameters
<T : Any>

route from a KClass for the destination

typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap()

map of destination arguments' kotlin type KType to its respective custom NavType. May be empty if T does not use custom NavTypes.

deepLinks: List<<Error class: unknown class>> = emptyList()

list of deep links to associate with the destinations

dialogProperties: DialogProperties = DialogProperties()

properties that should be passed to androidx.compose.ui.window.Dialog.

noinline content: @Composable (<Error class: unknown class>) -> Unit

composable content for the destination that will be hosted within the Dialog

fun <T : Any> <Error class: unknown class>.dialog(
    route: KClass<T>,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap(),
    deepLinks: List<<Error class: unknown class>> = emptyList(),
    dialogProperties: DialogProperties = DialogProperties(),
    content: @Composable (<Error class: unknown class>) -> Unit
): Unit

Add the Composable to the NavGraphBuilder that will be hosted within a androidx.compose.ui.window.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 destination that wants to show that dialog.

Parameters
route: KClass<T>

route from KClass of T for the destination

typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap()

map of destination arguments' kotlin type KType to its respective custom NavType. May be empty if route does not use custom NavTypes.

deepLinks: List<<Error class: unknown class>> = emptyList()

list of deep links to associate with the destinations

dialogProperties: DialogProperties = DialogProperties()

properties that should be passed to androidx.compose.ui.window.Dialog.

content: @Composable (<Error class: unknown class>) -> Unit

composable content for the destination that will be hosted within the Dialog

fun <Error class: unknown class>.dialog(
    route: String,
    arguments: List<<Error class: unknown class>> = emptyList(),
    deepLinks: List<<Error class: unknown class>> = emptyList(),
    dialogProperties: DialogProperties = DialogProperties(),
    content: @Composable (<Error class: unknown class>) -> Unit
): Unit

Add the Composable to the NavGraphBuilder that will be hosted within a androidx.compose.ui.window.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 destination that wants to show that dialog.

Parameters
route: String

route for the destination

arguments: List<<Error class: unknown class>> = emptyList()

list of arguments to associate with destination

deepLinks: List<<Error class: unknown class>> = emptyList()

list of deep links to associate with the destinations

dialogProperties: DialogProperties = DialogProperties()

properties that should be passed to androidx.compose.ui.window.Dialog.

content: @Composable (<Error class: unknown class>) -> Unit

composable content for the destination that will be hosted within the Dialog

inline fun <T : Any> <Error class: unknown class>.navigation(
    startDestination: Any,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap(),
    deepLinks: List<<Error class: unknown class>> = emptyList(),
    noinline enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null,
    noinline exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null,
    noinline popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition,
    noinline popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition,
    noinline sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null,
    noinline builder: <Error class: unknown class>.() -> Unit
): Unit

Construct a nested NavGraph

import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.SizeTransform
import androidx.compose.animation.core.keyframes
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.ui.unit.IntSize
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController

val navController = rememberNavController()
Box {
    NavHost(navController, startDestination = Collapsed) {
        composable<Collapsed>(
            enterTransition = { EnterTransition.None },
            exitTransition = { ExitTransition.None },
            sizeTransform = {
                SizeTransform { initialSize, targetSize ->
                    keyframes {
                        durationMillis = 500
                        IntSize(
                            initialSize.width,
                            (initialSize.height + targetSize.height) / 2
                        ) at 150
                    }
                }
            }
        ) {
            CollapsedScreen { navController.navigate(Expanded) }
        }
        composable<Expanded>(
            enterTransition = { EnterTransition.None },
            exitTransition = { ExitTransition.None },
            sizeTransform = {
                SizeTransform { initialSize, targetSize ->
                    keyframes {
                        durationMillis = 500
                        IntSize(targetSize.width, initialSize.height + 400) at 150
                    }
                }
            }
        ) {
            ExpandedScreen { navController.popBackStack() }
        }
    }
}
Parameters
<T : Any>

the destination's unique route from a KClass

startDestination: Any

the starting destination's route from an Object for this NavGraph

typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap()

map of destination arguments' kotlin type KType to its respective custom NavType. May be empty if T does not use custom NavTypes.

deepLinks: List<<Error class: unknown class>> = emptyList()

list of deep links to associate with the destinations

noinline enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null

callback to define enter transitions for destination in this NavGraph

noinline exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null

callback to define exit transitions for destination in this NavGraph

noinline popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition

callback to define pop enter transitions for destination in this NavGraph

noinline popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition

callback to define pop exit transitions for destination in this NavGraph

noinline sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null

callback to define the size transform for destinations in this NavGraph

noinline builder: <Error class: unknown class>.() -> Unit

the builder used to construct the graph

Returns
Unit

the newly constructed nested NavGraph

inline fun <T : Any> <Error class: unknown class>.navigation(
    startDestination: KClass<*>,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap(),
    deepLinks: List<<Error class: unknown class>> = emptyList(),
    noinline enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null,
    noinline exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null,
    noinline popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition,
    noinline popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition,
    noinline sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null,
    noinline builder: <Error class: unknown class>.() -> Unit
): Unit

Construct a nested NavGraph

import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.SizeTransform
import androidx.compose.animation.core.keyframes
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.ui.unit.IntSize
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController

val navController = rememberNavController()
Box {
    NavHost(navController, startDestination = Collapsed) {
        composable<Collapsed>(
            enterTransition = { EnterTransition.None },
            exitTransition = { ExitTransition.None },
            sizeTransform = {
                SizeTransform { initialSize, targetSize ->
                    keyframes {
                        durationMillis = 500
                        IntSize(
                            initialSize.width,
                            (initialSize.height + targetSize.height) / 2
                        ) at 150
                    }
                }
            }
        ) {
            CollapsedScreen { navController.navigate(Expanded) }
        }
        composable<Expanded>(
            enterTransition = { EnterTransition.None },
            exitTransition = { ExitTransition.None },
            sizeTransform = {
                SizeTransform { initialSize, targetSize ->
                    keyframes {
                        durationMillis = 500
                        IntSize(targetSize.width, initialSize.height + 400) at 150
                    }
                }
            }
        ) {
            ExpandedScreen { navController.popBackStack() }
        }
    }
}
Parameters
<T : Any>

the destination's unique route from a KClass

startDestination: KClass<*>

the starting destination's route from KClass for this NavGraph

typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap()

map of destination arguments' kotlin type KType to its respective custom NavType. May be empty if T does not use custom NavTypes.

deepLinks: List<<Error class: unknown class>> = emptyList()

list of deep links to associate with the destinations

noinline enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null

callback to define enter transitions for destination in this NavGraph

noinline exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null

callback to define exit transitions for destination in this NavGraph

noinline popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition

callback to define pop enter transitions for destination in this NavGraph

noinline popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition

callback to define pop exit transitions for destination in this NavGraph

noinline sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null

callback to define the size transform for destinations in this NavGraph

noinline builder: <Error class: unknown class>.() -> Unit

the builder used to construct the graph

Returns
Unit

the newly constructed nested NavGraph

fun <T : Any> <Error class: unknown class>.navigation(
    startDestination: Any,
    route: KClass<T>,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap(),
    deepLinks: List<<Error class: unknown class>> = emptyList(),
    enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null,
    exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null,
    popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition,
    popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null,
    builder: <Error class: unknown class>.() -> Unit
): Unit

Construct a nested NavGraph

import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.SizeTransform
import androidx.compose.animation.core.keyframes
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.ui.unit.IntSize
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController

val navController = rememberNavController()
Box {
    NavHost(navController, startDestination = Collapsed) {
        composable<Collapsed>(
            enterTransition = { EnterTransition.None },
            exitTransition = { ExitTransition.None },
            sizeTransform = {
                SizeTransform { initialSize, targetSize ->
                    keyframes {
                        durationMillis = 500
                        IntSize(
                            initialSize.width,
                            (initialSize.height + targetSize.height) / 2
                        ) at 150
                    }
                }
            }
        ) {
            CollapsedScreen { navController.navigate(Expanded) }
        }
        composable<Expanded>(
            enterTransition = { EnterTransition.None },
            exitTransition = { ExitTransition.None },
            sizeTransform = {
                SizeTransform { initialSize, targetSize ->
                    keyframes {
                        durationMillis = 500
                        IntSize(targetSize.width, initialSize.height + 400) at 150
                    }
                }
            }
        ) {
            ExpandedScreen { navController.popBackStack() }
        }
    }
}
Parameters
startDestination: Any

the starting destination's route from an Object for this NavGraph

route: KClass<T>

the destination's unique route from a KClass

typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap()

map of destination arguments' kotlin type KType to its respective custom NavType. May be empty if route does not use custom NavTypes.

deepLinks: List<<Error class: unknown class>> = emptyList()

list of deep links to associate with the destinations

enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null

callback to define enter transitions for destination in this NavGraph

exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null

callback to define exit transitions for destination in this NavGraph

popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition

callback to define pop enter transitions for destination in this NavGraph

popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition

callback to define pop exit transitions for destination in this NavGraph

sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null

callback to define the size transform for destinations in this NavGraph

builder: <Error class: unknown class>.() -> Unit

the builder used to construct the graph

Returns
Unit

the newly constructed nested NavGraph

fun <T : Any> <Error class: unknown class>.navigation(
    startDestination: KClass<*>,
    route: KClass<T>,
    typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap(),
    deepLinks: List<<Error class: unknown class>> = emptyList(),
    enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null,
    exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null,
    popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition,
    popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null,
    builder: <Error class: unknown class>.() -> Unit
): Unit

Construct a nested NavGraph

import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.SizeTransform
import androidx.compose.animation.core.keyframes
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.ui.unit.IntSize
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController

val navController = rememberNavController()
Box {
    NavHost(navController, startDestination = Collapsed) {
        composable<Collapsed>(
            enterTransition = { EnterTransition.None },
            exitTransition = { ExitTransition.None },
            sizeTransform = {
                SizeTransform { initialSize, targetSize ->
                    keyframes {
                        durationMillis = 500
                        IntSize(
                            initialSize.width,
                            (initialSize.height + targetSize.height) / 2
                        ) at 150
                    }
                }
            }
        ) {
            CollapsedScreen { navController.navigate(Expanded) }
        }
        composable<Expanded>(
            enterTransition = { EnterTransition.None },
            exitTransition = { ExitTransition.None },
            sizeTransform = {
                SizeTransform { initialSize, targetSize ->
                    keyframes {
                        durationMillis = 500
                        IntSize(targetSize.width, initialSize.height + 400) at 150
                    }
                }
            }
        ) {
            ExpandedScreen { navController.popBackStack() }
        }
    }
}
Parameters
startDestination: KClass<*>

the starting destination's route from KClass for this NavGraph

route: KClass<T>

the destination's unique route from a KClass

typeMap: Map<KType<Error class: unknown class><<Error class: unknown class>>> = emptyMap()

map of destination arguments' kotlin type KType to its respective custom NavType. May be empty if route does not use custom NavTypes.

deepLinks: List<<Error class: unknown class>> = emptyList()

list of deep links to associate with the destinations

enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null

callback to define enter transitions for destination in this NavGraph

exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null

callback to define exit transitions for destination in this NavGraph

popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition

callback to define pop enter transitions for destination in this NavGraph

popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition

callback to define pop exit transitions for destination in this NavGraph

sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null

callback to define the size transform for destinations in this NavGraph

builder: <Error class: unknown class>.() -> Unit

the builder used to construct the graph

Returns
Unit

the newly constructed nested NavGraph

fun <Error class: unknown class>.navigation(
    startDestination: String,
    route: String,
    arguments: List<<Error class: unknown class>> = emptyList(),
    deepLinks: List<<Error class: unknown class>> = emptyList(),
    enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null,
    exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null,
    popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition,
    popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition,
    sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null,
    builder: <Error class: unknown class>.() -> Unit
): Unit

Construct a nested NavGraph

import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.SizeTransform
import androidx.compose.animation.core.keyframes
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.ui.unit.IntSize
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController

val navController = rememberNavController()
Box {
    NavHost(navController, startDestination = Collapsed) {
        composable<Collapsed>(
            enterTransition = { EnterTransition.None },
            exitTransition = { ExitTransition.None },
            sizeTransform = {
                SizeTransform { initialSize, targetSize ->
                    keyframes {
                        durationMillis = 500
                        IntSize(
                            initialSize.width,
                            (initialSize.height + targetSize.height) / 2
                        ) at 150
                    }
                }
            }
        ) {
            CollapsedScreen { navController.navigate(Expanded) }
        }
        composable<Expanded>(
            enterTransition = { EnterTransition.None },
            exitTransition = { ExitTransition.None },
            sizeTransform = {
                SizeTransform { initialSize, targetSize ->
                    keyframes {
                        durationMillis = 500
                        IntSize(targetSize.width, initialSize.height + 400) at 150
                    }
                }
            }
        ) {
            ExpandedScreen { navController.popBackStack() }
        }
    }
}
Parameters
startDestination: String

the starting destination's route for this NavGraph

route: String

the destination's unique route

arguments: List<<Error class: unknown class>> = emptyList()

list of arguments to associate with destination

deepLinks: List<<Error class: unknown class>> = emptyList()

list of deep links to associate with the destinations

enterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = null

callback to define enter transitions for destination in this NavGraph

exitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = null

callback to define exit transitions for destination in this NavGraph

popEnterTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> EnterTransition?)? = enterTransition

callback to define pop enter transitions for destination in this NavGraph

popExitTransition: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> ExitTransition?)? = exitTransition

callback to define pop exit transitions for destination in this NavGraph

sizeTransform: (AnimatedContentTransitionScope<<Error class: unknown class>>.() -> SizeTransform?)? = null

callback to define the size transform for destinations in this NavGraph

builder: <Error class: unknown class>.() -> Unit

the builder used to construct the graph

Returns
Unit

the newly constructed nested NavGraph