Package-level declarations

Types

Link copied to clipboard

Accesses the graph-owner hierarchy of the destination currently being rendered.

Link copied to clipboard
sealed interface NavDeepLinkResult

Exhaustive result of strict deep-link resolution and optional navigation.

Link copied to clipboard
data class NavDestinationMotionSpec(val durationMillis: Long, val incomingStart: NavDestinationTransform = NavDestinationTransform(), val outgoingEnd: NavDestinationTransform = NavDestinationTransform(), val easing: NavMotionEasing = NavMotionEasing.Standard, val incomingAlphaTiming: NavMotionTiming = NavMotionTiming( durationMillis = durationMillis, easing = easing, ), val outgoingAlphaTiming: NavMotionTiming = NavMotionTiming( durationMillis = durationMillis, easing = easing, ))

Motion for one committed navigation command.

Link copied to clipboard
data class NavDestinationTransform(val travelFraction: Float = 0.0f, val travelDp: Float = 0.0f, val alpha: Float = 1.0f, val scale: Float = 1.0f)

Visual transform applied to one destination at an edge of a navigation transition.

Link copied to clipboard
data class NavFailure(val phase: NavFailurePhase, val failedEntry: NavEntry?, val frameReport: RenderFrameReport?, val cause: Throwable?, val stackCommitted: Boolean)

Complete diagnostic context captured when navigation rendering or commit fails.

Link copied to clipboard

Execution phase in which a NavHost transaction failed.

Link copied to clipboard

Android ownership boundary for one concrete navigation-graph instance.

Link copied to clipboard

Ordered graph-owner hierarchy for the destination currently being rendered.

Link copied to clipboard

Stable application-facing handle for one or more framework-owned navigation stacks.

Link copied to clipboard

Runtime exception that surfaces an otherwise unhandled NavFailure.

Link copied to clipboard

Timing path used by native navigation motion.

Link copied to clipboard
data class NavMotionTiming(val durationMillis: Long, val startDelayMillis: Long = 0, val easing: NavMotionEasing = NavMotionEasing.Linear)

Independent timing for one navigation property such as incoming or outgoing alpha.

Link copied to clipboard
data class NavPanePolicy(val strategy: NavPaneStrategy = NavPaneStrategies.BackStack, val minPaneWidthDp: Float = 320.0f, val maxPaneCount: Int = 3, val paneSpacingDp: Float = 0.0f)

Resolves the number of simultaneously visible navigation panes from native View width.

Link copied to clipboard
data class NavPredictiveBackSpec(val incomingStart: NavDestinationTransform, val incomingEnd: NavDestinationTransform = NavDestinationTransform(), val outgoingEnd: NavDestinationTransform, val progressEasing: NavMotionEasing = NavMotionEasing.Linear, val commitMotion: NavDestinationMotionSpec = DefaultCommitMotion, val cancelSpring: NavSpringSpec = DefaultCancelSpring, val velocitySampleWindowMillis: Long = 100, val maxProgressVelocity: Float = 4.0f)

Gesture-driven motion used before and immediately after a predictive Back transaction settles.

Link copied to clipboard
sealed interface NavResult

Synchronous result of a navigation command with the committed state observed at return time.

Link copied to clipboard
data class NavSpringSpec(val stiffness: Float, val dampingRatio: Float, val maxDurationMillis: Long = 500)

Physics used to settle gesture-driven navigation motion.

Link copied to clipboard
data class NavTransitionSpec(val push: NavDestinationMotionSpec = DefaultPush, val pop: NavDestinationMotionSpec = DefaultPop, val replace: NavDestinationMotionSpec = DefaultReplace, val reset: NavDestinationMotionSpec = DefaultReset, val stackSelection: NavDestinationMotionSpec = DefaultStackSelection, val deepLink: NavDestinationMotionSpec = DefaultDeepLink, val predictiveBack: NavPredictiveBackSpec = DefaultPredictiveBack)

Command-aware native View motion policy applied after navigation transactions commit.

Functions

Link copied to clipboard

Creates an unattached single-stack controller whose routes and deep links use graph.

fun createNavHostController(startDestination: NavRoute): NavHostController

Creates an unattached single-stack controller without graph resolution or deep links.

fun createNavHostController(stackConfiguration: NavStackConfiguration): NavHostController

Creates an unattached multi-stack controller without graph-based route resolution.

fun createNavHostController(stackConfiguration: NavStackConfiguration, graph: NavGraph): NavHostController

Creates an unattached multi-stack controller that resolves every stack through shared graph.

Link copied to clipboard
fun UiTreeBuilder.NavHost(controller: NavHostController, modifier: Modifier = Modifier, transitionSpec: NavTransitionSpec = NavTransitionSpec.Default, panePolicy: NavPanePolicy = NavPanePolicy.Single, systemBackEnabled: Boolean = true, contentKey: Any? = Unit, debug: Boolean = false, debugTag: String = "ViewComposeNavigation", overlayHostFactory: (ViewGroup) -> OverlayHost = defaultNavOverlayHostFactory, onFailure: (NavFailure) -> Unit? = null, key: Any? = null, content: UiTreeBuilder.(NavEntry) -> Unit)

Mounts one framework-owned navigation stack as a native Android View hierarchy.

Link copied to clipboard
fun UiTreeBuilder.ProvideNavGraphOwner(route: String, content: UiTreeBuilder.() -> Unit)

Runs content with the active graph identified by route as its Lifecycle, ViewModel, and saved-state owner.

Link copied to clipboard

Remembers a controller whose destinations are resolved through graph.

fun rememberNavHostController(startDestination: NavRoute): NavHostController

Remembers a controller and restores its complete host state through the current saveable-state registry.

fun rememberNavHostController(stackConfiguration: NavStackConfiguration): NavHostController

Remembers independently retained navigation stacks without graph-based route resolution.

fun rememberNavHostController(stackConfiguration: NavStackConfiguration, graph: NavGraph): NavHostController

Remembers independently retained navigation stacks whose routes share graph.