compose-navigation-nav3

Implement Jetpack Compose Navigation 3 with typed NavKey destinations and hoisted back stack state.

1|1|Updated May 23, 2026
One-click install
npx skills add https://github.com/santimattius/performance-compose-skills --skill compose-navigation-nav3
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-navigation-nav3
Source: https://github.com/santimattius/performance-compose-skills/tree/main/skills/compose-navigation-nav3
Command: npx skills add https://github.com/santimattius/performance-compose-skills --skill compose-navigation-nav3

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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.

Frequently Asked Questions about compose-navigation-nav3

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make Jetpack Compose Navigation 3 survive process death?

To make Jetpack Compose Navigation 3 survive process death, use typed `@Serializable` NavKey destinations and manage state with `rememberNavBackStack`, ensuring the back stack restores correctly after the system kills the app.

How do I migrate string routes from Nav2 to Nav3?

Migrating string routes from Nav2 to Nav3 requires replacing string-based routes with typed `@Serializable` NavKey objects. You must also translate Nav2 mental models, noting that Nav3 currently does not support string routes or deep links.

Why do ViewModels leak when using NavDisplay in multiplatform navigation?

ViewModels leak in NavDisplay when missing the required `rememberViewModelStoreNavEntryDecorator`. Adding this decorator to your NavDisplay setup properly scopes ViewModel lifecycles to back-stack entries and prevents memory leaks.

Can I use Nav3 for multi-pane list-detail layouts and dialogs?

Yes, Nav3 supports multi-pane list-detail layouts and dialogs using SceneStrategy patterns. You can wire `SinglePaneSceneStrategy`, `rememberListDetailSceneStrategy`, and `DialogSceneStrategy` to manage complex UI layouts.

What Nav2 features are unsupported in Navigation 3?

Navigation 3 currently does not support deep links, string routes, shared destinations across back stacks, and nested graphs deeper than one level, requiring architectural changes when migrating from Nav2.