Recipes The recipes app contains runnable examples. Each recipe shows one concept. The recipe source is in the recipes directory of the repository.
Where a recipe matches a recipe in Google’s Navigation 3 recipes , the “Navigation 3 recipe” column names the Navigation 3 recipe.
Run the recipes app Clone the repository, then run one of these commands from the repository root:
Platform Command Desktop ./gradlew :recipes:app:desktop:run Android ./gradlew :recipes:app:android:installDebug, then open “Enro Recipes” on the device Web ./gradlew :recipes:app:web:wasmJsBrowserDevelopmentRun iOS Open EnroRecipes.xcodeproj in Xcode and run the project
Basic Recipe Shows Navigation 3 recipe Basic Navigation open, close, and keys with arguments Basic Saveable Back Stack A backstack and rememberSaveable state that are restored after a configuration change Saveable back stack Saved State How long state is kept by remember, rememberSaveable, a ViewModel and SavedStateHandle Saveable back stack Destination Registration Function and provider destinations; dialog() and directOverlay() metadata Entry provider DSL Back Stack Operations Back to root, back to a specific screen, replace the current screen, clear the stack — Basic Deep Link @NavigationPath, hand-written path bindings, and resolving a URL to a key Uri with Arguments Handling a Deep Link Opening a destination from a URL that the app receives from outside the app Static Uri Advanced Deep Link A synthetic backstack for a deep link Synthetic BackStack
Scenes and overlays Animations State and results Recipe Shows Navigation 3 recipe Basic ViewModel A NavigationHandle inside a ViewModel Basic ViewModel Koin ViewModel A ViewModel with dependencies from Koin and arguments from the destination’s key Koin injected ViewModel Koin Modular Features that each provide a Koin module and open each other’s screens by key Koin modular Metro ViewModel A ViewModel with dependencies from a Metro graph and arguments from the destination’s key Metro injected ViewModel Metro Modular Features that contribute to one Metro graph and open each other’s screens by key Metro modular Shared ViewModel One ViewModel used by several destinations Shared ViewModel Sharing State with Results Passing a value to a child screen and receiving the edited value as a result — Returning Results NavigationKey.WithResult and registerForNavigationResult Results as Events Results in a ViewModel Requesting and receiving a result from a ViewModel — Managed Flow A multi-step flow as a destination — Flow in a ViewModel A multi-step flow declared in a ViewModel — Request-Close Confirmation Confirming before a screen closes —
Advanced Synthetic destinations Recipe Shows Navigation 3 recipe External URL Launcher A key that runs a side effect and shows no screen — Auth Gate A key that redirects to a login screen Conditional navigation Result Decider A key that forwards another destination’s result —
Interop Recipe Shows Navigation 3 recipe Native Interop A platform view (AndroidView, SwingPanel) inside a destination Fragment and View Interop
Each platform recipe is listed only in the recipes app for that platform, under “This Platform”.
Recipe Platform Shows Navigation 3 recipe Fragment and Activity Android A Fragment and an Activity as destinations; the Activity returns a result Fragment and View Interop UIViewController iOS A UIViewController as a destination: embedded, presented modally, and pushed — Multiple Windows Desktop A destination that opens in a separate window and returns a result —
Tests RecipeSmokeTests runs the recipes on desktop with Compose UI tests. RecipeSmokeTests is also an example of a navigation test that uses the real UI: each test installs the app’s NavigationComponent, shows a container, and clicks through a recipe. Run RecipeSmokeTests with ./gradlew :recipes:common:desktopTest.