compose-navigation

Configure type-safe Jetpack Compose navigation with @Serializable routes and deep links.

Updated Mar 9, 2025
One-click install
npx skills add https://github.com/rock-hu/vitamin-compose --skill compose-navigation-rock-hu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compose-navigation
Source: https://github.com/rock-hu/vitamin-compose/tree/main/.github/skills/compose-navigation
Command: npx skills add https://github.com/rock-hu/vitamin-compose --skill compose-navigation-rock-hu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies implementing robust, type-safe navigation in Jetpack Compose applications by providing a structured approach to route definitions, argument passing, deep linking, and nested navigation graphs.

Core Features & Use Cases

  • Type-safe routes using @Serializable data classes for Home, Profile(userId), Settings(section: String? = null), and other destinations.
  • Centralized NavHost and NavController setup with clear navigation actions and back-stack management.
  • Deep links, nested graphs, and adaptive navigation to support both phones and tablets.
  • Testing patterns for navigation flows using Compose test rules and a TestNavHostController.
  • Use Case: Build a two-screen flow with a profile screen navigated from a home screen and accessible via a deep link.

Quick Start

Create a simple app with a NavHost containing Home and Profile destinations, wire a navigation action from Home to Profile, and add a deep link to Profile for direct access.

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 is implemented using @Serializable data classes to define routes, enabling structured argument passing and deep linking within a centralized NavHost and NavController setup.

What's the best way to pass arguments between Jetpack Compose screens?

The best way to pass arguments in Jetpack Compose is using type-safe routes defined by @Serializable data classes, such as Profile(userId), which enforces structured and testable argument passing across multi-screen apps.

How do I add deep links to a Jetpack Compose navigation graph?

Deep links are added to a Jetpack Compose navigation graph by configuring the NavHost to support direct access to destinations like Profile, enabling external routing into specific screens.

Does Jetpack Compose Navigation support adaptive layouts for tablets?

Jetpack Compose Navigation supports adaptive layouts for tablets by providing structured navigation flows, nested graphs, and reusable patterns that adjust to both phone and tablet screen sizes.

How do you test navigation flows in a Jetpack Compose app?

Navigation flows in a Jetpack Compose app are tested using Compose test rules alongside a TestNavHostController to validate route definitions, argument passing, and multi-screen back-stack management.

When do I need nested navigation graphs in Jetpack Compose?

Nested navigation graphs in Jetpack Compose are needed when organizing complex, multi-screen apps into structured flows, ensuring clear back-stack management and reusable navigation patterns within a centralized NavHost.