What problem does it solve?
compose-navigation-nav3 helps you implement Jetpack Compose Navigation 3 correctly so that navigation state, destination arguments, and ViewModel lifecycles behave safely—especially across recomposition and Android process death—while avoiding costly mistakes during Nav2→Nav3 migrations.
Core Features & Use Cases
- NavKey-driven typed destinations: enforce
NavKey + @Serializable on every route to enable back-stack restore after process death.
- Hoisted back stack with
rememberNavBackStack: ensure process-death save/restore by managing the back stack as state rather than relying on Nav2-style controllers.
- Required ViewModel decorators: use
rememberViewModelStoreNavEntryDecorator (and optionally rememberSaveableStateHolderNavEntryDecorator) to prevent ViewModel leaks and preserve per-entry UI state.
- SceneStrategy patterns for multi-pane and dialogs: wire
SinglePaneSceneStrategy, rememberListDetailSceneStrategy, and DialogSceneStrategy, with guidance for custom bottom-sheet navigation.
- Nav2→Nav3 migration mapping: translate mental models and identify unsupported Nav2 features (deep links, nested graphs > 1 level, shared destinations across back stacks, string routes).
Quick Start
Use compose-navigation-nav3 when implementing Nav3 navigation by creating typed @Serializable NavKey destinations, initializing your back stack with rememberNavBackStack, and wiring NavDisplay with rememberViewModelStoreNavEntryDecorator() plus the appropriate SceneStrategy.