navigation-3

Migrate Android apps from Navigation 2 to Jetpack Navigation 3 and implement Compose navigation patterns.

Updated May 21, 2025
One-click install
npx skills add https://github.com/albertmartorell1975/MeteoMartoCompose --skill navigation-3-albertmartorell1975
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: navigation-3
Source: https://github.com/albertmartorell1975/MeteoMartoCompose/tree/main/.agents/skills/navigation-3
Command: npx skills add https://github.com/albertmartorell1975/MeteoMartoCompose --skill navigation-3-albertmartorell1975

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Migrating an Android app from Jetpack Navigation 2 to Navigation 3 involves many coordinated changes—dependencies, NavKey routes, back stack state holders, entryProvider DSL, and NavDisplay—and developers also need working patterns for deep links, dialogs, bottom sheets, and adaptive layouts. ## Core Features & Use Cases - Step-by-step migration guide: Replace NavController and NavHost with NavigationState, Navigator, entryProvider, and NavDisplay, including dependency and SDK updates. - Navigation recipes: Ready-made code examples for multiple back stacks, deep links, dialogs, bottom sheets, list-detail and two-pane scenes, conditional navigation, animations, and returning results. - Architecture integration: Patterns for Hilt or Koin modularization, ViewModel argument passing, and type-safe destinations with Kotlin serialization. - Use Case: An Android developer with a Compose app using string-based Navigation 2 routes can follow the type-safe migration guide, then apply the Navigation 3 migration steps and recipes to rebuild navigation with full back stack control. ## Quick Start Ask the AI to migrate your Android app from Navigation 2 to Navigation 3 using the official migration guide and recipes.

Frequently Asked Questions about navigation-3

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

FAQPage Schema
How do I migrate from Navigation 2 to Navigation 3?▼

Add the navigation3-runtime and navigation3-ui dependencies, make routes implement NavKey, create NavigationState and Navigator classes, move destinations into an entryProvider, and replace NavHost with NavDisplay. Finally remove all Navigation 2 dependencies.

How do I implement type-safe navigation in Jetpack Compose?▼

Replace string routes with @Serializable data objects and data classes, update NavHost to use composable<T> generics, and navigate with class instances like navController.navigate(Profile(userId)). ViewModels can extract arguments via SavedStateHandle.toRoute().

Does Navigation 3 support Fragments and Views?▼

Navigation 3 is designed exclusively for Compose destinations. To use Fragments and Views, you must wrap them using Compose interoperability APIs such as AndroidView before adding them as destinations.

What are the limitations of the Navigation 3 migration guide?▼

The guide does not cover nested navigation beyond one level, shared destinations across back stacks, custom destination types, or deep links. Deep links and bottom sheets are instead demonstrated through separate code recipes.

How do I show a destination as a bottom sheet in Navigation 3?▼

Create a BottomSheetSceneStrategy and pass it to NavDisplay's sceneStrategies parameter, then add BottomSheetSceneStrategy.bottomSheet() metadata to the entry. The strategy class is not in the core library, so copy it from the recipes into your project.

Can Navigation 3 handle conditional navigation like login flows?▼

Yes, the conditional navigation recipe shows a custom Navigator that checks a requiresLogin flag on each NavKey. Unauthenticated users are redirected to a Login key, and after login they are sent to their originally requested destination.