compose-navigation

Implement type-safe navigation in Jetpack Compose with NavHost and @Serializable routes.

8|1|Updated Jun 12, 2018
One-click install
npx skills add https://github.com/SheTieJun/BaseKit --skill compose-navigation-shetiejun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-navigation
Source: https://github.com/SheTieJun/BaseKit/tree/main/.trae/skills/compose-navigation
Command: npx skills add https://github.com/SheTieJun/BaseKit --skill compose-navigation-shetiejun

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables type-safe navigation in Jetpack Compose applications, simplifying cross-screen data flow and deep linking while reducing boilerplate.

Core Features & Use Cases

  • Type-safe routes using @Serializable route objects to ensure compile-time safety when navigating between screens.
  • NavHost setup with rememberNavController, nested graphs, and support for passing arguments and deep links.
  • Testing and patterns for navigation across multi-screen apps.
  • Use Case: Build a three-screen flow (Home -> Detail with id, and Settings) with deep links and back-stack handling.

Quick Start

Initialize AppNavigation() with a NavHost and a rememberNavController, define routes for Home, Detail, and Settings, and wire navigation actions between them. Then, validate the navigation flows with a few representative automated tests.

Frequently Asked Questions about compose-navigation

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

FAQPage Schema
How do I implement type-safe navigation in Jetpack Compose?

Type-safe navigation in Jetpack Compose uses @Serializable route objects to ensure compile-time safety when passing arguments between screens. You set up a NavHost with rememberNavController, define composable routes, and wire navigation actions to handle cross-screen data flow.

Does Jetpack Compose navigation support deep links and nested graphs?

Yes, Jetpack Compose navigation supports deep links and nested graphs within a NavHost setup. You can structure multi-screen flows by defining nested graphs and passing arguments to specific composable destinations to handle deep link triggers.

What's the best way to handle multi-screen bottom navigation and drawers in Compose?

Handling multi-screen bottom navigation and drawers in Compose requires a NavHost and rememberNavController to manage the back-stack. You define composable routes for each screen and wire navigation actions to switch between destinations while maintaining adaptive navigation patterns.

Do I need Kotlin serialization for type-safe routes in Android Compose?

Yes, Kotlin serialization is required for type-safe routes in Android Compose. Using @Serializable route objects provides compile-time safety and reduces boilerplate when passing arguments between screens and setting up deep links.

How do I test navigation flows across multiple screens in a Compose app?

Testing navigation flows across multiple screens in a Compose app involves validating the NavHost setup and back-stack handling with automated tests. You verify that navigation actions between routes correctly pass arguments and trigger deep links under common app architectures.