NavHost

fun NavHost(navController: NavHostController, startNavDestination: NavDestination<*>, modifier: Modifier = Modifier, contentAlignment: Alignment = Alignment.Center, route: String? = null, enterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = { fadeIn(animationSpec = tween(700)) }, exitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = { fadeOut(animationSpec = tween(700)) }, popEnterTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> EnterTransition = enterTransition, popExitTransition: AnimatedContentTransitionScope<NavBackStackEntry>.() -> ExitTransition = exitTransition, builder: NavGraphBuilder.() -> Unit)

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.

This function wraps androidx.navigation.compose.NavHost.

Parameters

navController

the navController for this host

startNavDestination

the start NavDestination

modifier

The modifier to be applied to the layout.

contentAlignment
route

the route for the graph

enterTransition

callback to define enter transitions for destination in this host

exitTransition

callback to define exit transitions for destination in this host

popEnterTransition

callback to define popEnter transitions for destination in this host

popExitTransition

callback to define popExit transitions for destination in this host

builder

the builder used to construct the graph