Jetpack Navigation 3 model 1.0 is steady 🎉. Go forward and use it in your manufacturing apps as we speak. JetBrains are already utilizing it of their KotlinConf app.Â
Navigation 3 is a brand new navigation library constructed from the bottom as much as embrace Jetpack Compose state. It offers you full management over your again stack, helps you keep navigation state, and permits you to simply create adaptive layouts (like list-detail). There’s even a cross-platform model from JetBrains.Â
Why a brand new library?
The unique Jetpack Navigation library (now Nav2) was designed 7 years in the past and, whereas it serves its unique objectives properly and has been improved iteratively, the way in which apps at the moment are constructed has basically modified.Â
Reactive programming with a declarative UI is now the norm. Nav3 embraces this strategy. For instance, NavDisplay (the Nav3 UI element that shows your screens) merely observes a listing of keys (every one representing a display screen) backed by Compose state and updates its UI when that checklist modifications.Â
Determine 1. NavDisplay observes modifications to a listing backed by Compose state.
Nav2 may make it tough to have a single supply of fact on your navigation state as a result of it has its personal inner state. With Nav3, you provide your personal state, which provides you full management.
Lastly, you requested for extra flexibility and customizability. Relatively than having a single, monolithic API, Nav3 offers smaller, decoupled APIs (or “constructing blocks”) that may be mixed collectively to create complicated performance. Nav3 itself makes use of these constructing blocks to offer smart defaults for well-defined navigation use instances.Â
This strategy permits you to:Â
Learn extra about its design and options within the launch weblog.Â
Migrating from Navigation 2
When you’re already utilizing Nav2, particularly Navigation Compose, it’s best to take into account migrating to Nav3. To help you with this, there’s a migration information. The important thing steps are:Â
Add the navigation 3 dependencies.Â
Replace your navigation routes to implement NavKey. Your routes do not must implement this interface to make use of Nav3, but when they do, you’ll be able to reap the benefits of Nav3’s rememberNavBackStack perform to create a persistent again stack.Â
Create lessons to carry and modify your navigation state – that is the place your again stacks are held.Â
Substitute NavController with these lessons.
Transfer your locations from NavHost‘s NavGraph into an entryProvider.
Substitute NavHost with NavDisplay.
Experimenting with AI agent migration
It’s possible you’ll need to experiment with utilizing an AI agent to learn the migration information and carry out the steps in your mission. To do this with Gemini in Android Studio’s Agent Mode:
Save this markdown model of the information into your mission.Â
Paste this immediate to the agent (however do not hit enter): “Migrate this mission to Navigation 3 utilizing “.
Kind @migration-guide.md – it will provide the information as context to the agent.Â
As at all times, be sure to fastidiously overview the modifications made by the AI agent – it could make errors!Â
We would love to listen to the way you or your agent carried out, please ship your suggestions right here.
Tasty navigation recipes for widespread eventualities
For widespread however nuanced use instances, we now have a recipes repository. This reveals mix the Nav3 APIs in a specific method, permitting you to decide on or modify the recipe to your explicit wants. If a recipe seems to be well-liked, we’ll take into account “graduating” the non-nuanced components of it into the core Nav3 library or add-on libraries.Â
Determine 2. Helpful code recipes can graduate right into a library.
There are at the moment 19 recipes, together with for:Â
We’re at the moment engaged on a deeplinks recipe, plus a Koin integration, and have loads of others deliberate. An engineer from JetBrains has additionally revealed a Compose Multiplatform model of the recipes.
When you have a standard use case that you simply’d prefer to see a recipe for, please file a recipe request.Â
Abstract
To get began with Nav3, try the docs and the recipes. Plus, preserve a watch out for an entire week of technical content material together with:Â
A deep dive video on the API masking modularization, animations and adaptive layouts.
A reside Ask Me Something (AMA) with the engineers who constructed Nav3.
Nav3 Highlight Week begins Dec 1st 2025.Â
As at all times, when you discover any points, please file them right here.
