android-navigation-compose

Configure single NavController navigation with NavHost in Jetpack Compose.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/jperezdelreal/GymBro --skill android-navigation-compose
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-navigation-compose
Source: https://github.com/jperezdelreal/GymBro/tree/main/.squad/skills/android/android-navigation-compose
Command: npx skills add https://github.com/jperezdelreal/GymBro --skill android-navigation-compose

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Android app navigation in Jetpack Compose often becomes complex and hard to maintain as apps scale. This skill provides expert guidance on setting up a single NavController with NavHost, bottom navigation, type-safe argument passing, savedStateHandle for cross-screen data, and robust testing to avoid common pitfalls.

Core Features & Use Cases

  • Setup a single NavController with a central NavHost and dynamic start destinations
  • Implement bottom navigation with proper back stack management and state restoration
  • Pass primitive route arguments and use savedStateHandle for complex objects and data sharing
  • Apply global enter/exit transitions and per-destination overrides to ensure smooth navigation
  • Validate navigation flows with tests and guard against common anti-patterns

Quick Start

Wire a single NavController at the host and implement the NavHost with the defined routes to apply these patterns.

Frequently Asked Questions about android-navigation-compose

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

FAQPage Schema
How do I set up a single NavController with NavHost for Jetpack Compose navigation?

To set up Jetpack Compose navigation, wire a single NavController at the host level and implement a central NavHost with defined routes and dynamic start destinations to manage screen transitions.

How does savedStateHandle work for passing complex objects between Compose navigation destinations?

savedStateHandle persists complex objects and shares cross-screen data during Compose navigation. Primitive route arguments handle simple values, while savedStateHandle manages larger datasets across destination changes.

What is the best way to implement bottom navigation with proper back stack management in Android Compose?

The best way to implement bottom navigation in Android Compose is using a single NavController to manage the back stack and restore state, avoiding common anti-patterns associated with multiple controllers.

Can I apply global enter and exit transitions to a Compose NavHost while overriding specific destinations?

Yes, you can apply global enter and exit transitions to a Compose NavHost for smooth navigation, while also configuring per-destination overrides to customize specific screen animations.

How do I test Android navigation flows in Jetpack Compose to avoid common anti-patterns?

Test Android navigation flows in Jetpack Compose by validating route transitions and back stack behavior. This guards against common anti-patterns like multiple NavControllers and improper state restoration.