compose-navigation

Implement type-safe navigation in Jetpack Compose with Navigation Compose.

Updated May 29, 2016
One-click install
npx skills add https://github.com/AerisG222/maw-photos-android --skill compose-navigation-aerisg222
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-navigation
Source: https://github.com/AerisG222/maw-photos-android/tree/main/.github/skills/compose-navigation
Command: npx skills add https://github.com/AerisG222/maw-photos-android --skill compose-navigation-aerisg222

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires androidx.navigation:navigation-compose, org.jetbrains.kotlinx:kotlinx-serialization-json, and includes references (resource) components.

What problem does it solve?

This Skill simplifies and standardizes navigation within Jetpack Compose Android applications, ensuring type-safe navigation, efficient argument passing, and robust deep linking.

Core Features & Use Cases

  • Type-Safe Routing: Define navigation routes using serializable data classes for compile-time safety.
  • Argument Passing: Securely pass primitive and complex data between screens.
  • Deep Linking: Configure and handle deep links to specific app destinations.
  • Nested Navigation: Structure complex navigation flows using nested graphs.
  • Adaptive Layouts: Implement responsive navigation patterns like bottom navigation bars and navigation rails.
  • Testing: Provides utilities for testing navigation logic.

Quick Start

Add the Navigation Compose dependency to your app's build.gradle.kts file.

Frequently Asked Questions about compose-navigation

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

FAQPage Schema
How do I set up type-safe routing in Jetpack Compose?

Type-safe routing in Jetpack Compose defines navigation routes using serializable data classes for compile-time safety. You configure the NavHost and leverage kotlinx serialization to manage route definitions and argument passing securely.

How does deep linking work in Navigation Compose?

Deep linking in Navigation Compose configures specific app destinations to handle incoming external links. You define deep links within your NavHost graph structure to route users directly to targeted screens.

Can I use nested navigation graphs to structure complex Compose flows?

Yes, nested navigation graphs structure complex navigation flows in Compose applications. You can group related destinations within a parent NavHost to organize user journeys and manage nested routing logic effectively.

What is the best way to pass complex arguments between Compose screens?

The best way to pass complex arguments between Compose screens uses kotlinx serialization for type safety. This approach securely transmits primitive and complex data structures between destinations without manual parsing errors.

Do I need kotlinx-serialization-json for Navigation Compose argument passing?

Yes, you need kotlinx-serialization-json to define type-safe navigation routes and securely pass complex arguments. It works alongside androidx.navigation:navigation-compose to serialize route definitions and ensure compile-time validation.

How do I implement adaptive navigation patterns for Android Compose apps?

Adaptive navigation patterns in Android Compose apps implement responsive layouts like bottom navigation bars and navigation rails. You structure your NavHost to switch between these interface components based on screen size constraints.