The android/nav3-recipes repository is a collection of code recipes demonstrating how to implement common navigation use cases with Jetpack Navigation 3, a library for managing app navigation in Android. Written in Kotlin, the repository serves as practical documentation for developers learning to use Navigation 3's APIs, with each recipe focused on introducing a single concept rather than building complexity into existing examples.
The repository contains recipes organized into multiple categories covering different aspects of navigation. Basic API usage recipes demonstrate fundamental Navigation 3 patterns, including saveable back stacks, parcelable back stacks, and entry provider DSL approaches. Deep linking recipes show both basic URL parsing from Android Intents and advanced scenarios involving synthetic back stacks and correct "Up" navigation behavior. The scenes category includes recipes for built-in scenes like dialogs, custom scenes such as bottom sheets and list-detail layouts, and integration with Material Design 3 adaptive navigation layouts. Scene decorators are demonstrated through dialog scene decorators and responsive navigation decorators that add UI elements like top app bars and navigation rails.
Additional recipe categories address animations, common back stack behavior patterns including multiple back stacks with state retention, conditional navigation for authentication flows, and architectural approaches using dependency injection frameworks like Hilt, Koin, and Metro. The repository includes recipes for modularized navigation code and dynamic feature module integration. Working with ViewModels is extensively covered, including recipes for passing navigation arguments through basic ViewModels, Hilt-injected ViewModels, and Koin-injected ViewModels, as well as sharing ViewModels between screens. Recipes also demonstrate retaining values for composables on the back stack, returning results between screens through both events and state, and interoperability with Fragments and Views.
The repository shares contributors with jetbrains/compose-multiplatform, android/nowinandroid, and immich-app/immich, indicating cross-project collaboration within the Android ecosystem.
The repository follows a philosophy where patterns demonstrated in recipes can graduate into optional helpers within the Navigation 3 library itself, ensuring recipes remain current best practices. The main branch uses the latest Navigation 3 versions, which may include alpha or snapshot releases, while stable versions are available through the releases page.