NavHost

Functions summary

Unit
@Composable
NavHost(
    navController: NavHostController,
    graph: NavGraph,
    modifier: Modifier,
    contentAlignment: Alignment,
    enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition,
    exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition,
    popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition,
    popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition,
    predictivePopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> EnterTransition,
    predictivePopExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> ExitTransition,
    sizeTransform: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?)?
)

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

Cmn
Unit
@Composable
NavHost(
    navController: NavHostController,
    startDestination: String,
    modifier: Modifier,
    contentAlignment: Alignment,
    route: String?,
    enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition,
    exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition,
    popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition,
    popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition,
    predictivePopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> EnterTransition,
    predictivePopExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> ExitTransition,
    sizeTransform: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?)?,
    builder: NavGraphBuilder.() -> Unit
)

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

Cmn
Unit
@Composable
NavHost(
    navController: NavHostController,
    startDestination: Any,
    modifier: Modifier,
    contentAlignment: Alignment,
    route: KClass<*>?,
    typeMap: Map<KTypeNavType<*>>,
    enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition,
    exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition,
    popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition,
    popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition,
    predictivePopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> EnterTransition,
    predictivePopExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> ExitTransition,
    sizeTransform: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?)?,
    builder: NavGraphBuilder.() -> Unit
)

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

Cmn
Unit
@Composable
NavHost(
    navController: NavHostController,
    startDestination: KClass<*>,
    modifier: Modifier,
    contentAlignment: Alignment,
    route: KClass<*>?,
    typeMap: Map<KTypeNavType<*>>,
    enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition,
    exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition,
    popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition,
    popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition,
    predictivePopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> EnterTransition,
    predictivePopExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> ExitTransition,
    sizeTransform: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?)?,
    builder: NavGraphBuilder.() -> Unit
)

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

Cmn

Functions

@Composable
fun NavHost(
    navController: NavHostController,
    graph: NavGraph,
    modifier: Modifier = Modifier,
    contentAlignment: Alignment = Alignment.TopStart,
    enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = DefaultNavTransitions.enterTransition,
    exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = DefaultNavTransitions.exitTransition,
    popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = enterTransition,
    popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = exitTransition,
    predictivePopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> EnterTransition = DefaultNavTransitions.predictivePopEnterTransition,
    predictivePopExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> ExitTransition = DefaultNavTransitions.predictivePopExitTransition,
    sizeTransform: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?)? = DefaultNavTransitions.sizeTransform
): 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: NavHostController

the navController for this host

graph: NavGraph

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<NavBackStackEntry>.() -> EnterTransition = DefaultNavTransitions.enterTransition

callback to define enter transitions for destination in this host

exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = DefaultNavTransitions.exitTransition

callback to define exit transitions for destination in this host

popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = enterTransition

callback to define popEnter transitions for destination in this host

popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = exitTransition

callback to define popExit transitions for destination in this host

predictivePopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> EnterTransition = DefaultNavTransitions.predictivePopEnterTransition

callback to define predictivePopEnter transitions for destination in this host

predictivePopExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> ExitTransition = DefaultNavTransitions.predictivePopExitTransition

callback to define predictivePopExit transitions for destination in this host

sizeTransform: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?)? = DefaultNavTransitions.sizeTransform

callback to define the size transform for destinations in this host

@Composable
fun NavHost(
    navController: NavHostController,
    startDestination: String,
    modifier: Modifier = Modifier,
    contentAlignment: Alignment = Alignment.TopStart,
    route: String? = null,
    enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = DefaultNavTransitions.enterTransition,
    exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = DefaultNavTransitions.exitTransition,
    popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = enterTransition,
    popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = exitTransition,
    predictivePopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> EnterTransition = DefaultNavTransitions.predictivePopEnterTransition,
    predictivePopExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> ExitTransition = DefaultNavTransitions.predictivePopExitTransition,
    sizeTransform: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?)? = DefaultNavTransitions.sizeTransform,
    builder: NavGraphBuilder.() -> 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: NavHostController

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<NavBackStackEntry>.() -> EnterTransition = DefaultNavTransitions.enterTransition

callback to define enter transitions for destination in this host

exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = DefaultNavTransitions.exitTransition

callback to define exit transitions for destination in this host

popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = enterTransition

callback to define popEnter transitions for destination in this host

popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = exitTransition

callback to define popExit transitions for destination in this host

predictivePopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> EnterTransition = DefaultNavTransitions.predictivePopEnterTransition

callback to define predictivePopEnter transitions for destination in this host

predictivePopExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> ExitTransition = DefaultNavTransitions.predictivePopExitTransition

callback to define predictivePopExit transitions for destination in this host

sizeTransform: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?)? = DefaultNavTransitions.sizeTransform

callback to define the size transform for destinations in this host

builder: NavGraphBuilder.() -> Unit

the builder used to construct the graph

@Composable
fun NavHost(
    navController: NavHostController,
    startDestination: Any,
    modifier: Modifier = Modifier,
    contentAlignment: Alignment = Alignment.TopStart,
    route: KClass<*>? = null,
    typeMap: Map<KTypeNavType<*>> = emptyMap(),
    enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = DefaultNavTransitions.enterTransition,
    exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = DefaultNavTransitions.exitTransition,
    popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = enterTransition,
    popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = exitTransition,
    predictivePopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> EnterTransition = DefaultNavTransitions.predictivePopEnterTransition,
    predictivePopExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> ExitTransition = DefaultNavTransitions.predictivePopExitTransition,
    sizeTransform: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?)? = DefaultNavTransitions.sizeTransform,
    builder: NavGraphBuilder.() -> 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: NavHostController

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<KTypeNavType<*>> = 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<NavBackStackEntry>.() -> EnterTransition = DefaultNavTransitions.enterTransition

callback to define enter transitions for destination in this host

exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = DefaultNavTransitions.exitTransition

callback to define exit transitions for destination in this host

popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = enterTransition

callback to define popEnter transitions for destination in this host

popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = exitTransition

callback to define popExit transitions for destination in this host

predictivePopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> EnterTransition = DefaultNavTransitions.predictivePopEnterTransition

callback to define predictivePopEnter transitions for destination in this host

predictivePopExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> ExitTransition = DefaultNavTransitions.predictivePopExitTransition

callback to define predictivePopExit transitions for destination in this host

sizeTransform: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?)? = DefaultNavTransitions.sizeTransform

callback to define the size transform for destinations in this host

builder: NavGraphBuilder.() -> Unit

the builder used to construct the graph

@Composable
fun NavHost(
    navController: NavHostController,
    startDestination: KClass<*>,
    modifier: Modifier = Modifier,
    contentAlignment: Alignment = Alignment.TopStart,
    route: KClass<*>? = null,
    typeMap: Map<KTypeNavType<*>> = emptyMap(),
    enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = DefaultNavTransitions.enterTransition,
    exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = DefaultNavTransitions.exitTransition,
    popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = enterTransition,
    popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = exitTransition,
    predictivePopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> EnterTransition = DefaultNavTransitions.predictivePopEnterTransition,
    predictivePopExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> ExitTransition = DefaultNavTransitions.predictivePopExitTransition,
    sizeTransform: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?)? = DefaultNavTransitions.sizeTransform,
    builder: NavGraphBuilder.() -> 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: NavHostController

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<KTypeNavType<*>> = 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<NavBackStackEntry>.() -> EnterTransition = DefaultNavTransitions.enterTransition

callback to define enter transitions for destination in this host

exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = DefaultNavTransitions.exitTransition

callback to define exit transitions for destination in this host

popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = enterTransition

callback to define popEnter transitions for destination in this host

popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = exitTransition

callback to define popExit transitions for destination in this host

predictivePopEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> EnterTransition = DefaultNavTransitions.predictivePopEnterTransition

callback to define predictivePopEnter transitions for destination in this host

predictivePopExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.(Int) -> ExitTransition = DefaultNavTransitions.predictivePopExitTransition

callback to define predictivePopExit transitions for destination in this host

sizeTransform: (AnimatedContentTransitionScope<NavBackStackEntry>.() -> SizeTransform?)? = DefaultNavTransitions.sizeTransform

callback to define the size transform for destinations in this host

builder: NavGraphBuilder.() -> Unit

the builder used to construct the graph