kmp-navigation

Configure Navigation 3 with typed routes and ViewModel lifecycles in Kotlin Multiplatform Compose.

1|Updated Nov 26, 2025
One-click install
npx skills add https://github.com/niltsiar/kotlin_multiplatform_pokedex --skill kmp-navigation-niltsiar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kmp-navigation
Source: https://github.com/niltsiar/kotlin_multiplatform_pokedex/tree/main/.agents/kmp-navigation
Command: npx skills add https://github.com/niltsiar/kotlin_multiplatform_pokedex --skill kmp-navigation-niltsiar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Navigation 3 modular architecture for Kotlin Multiplatform Compose provides a scalable, type-safe approach to sharing navigation contracts, wiring, and per-route lifecycles across Android, iOS, and Desktop, reducing boilerplate and drift between platforms.

Core Features & Use Cases

  • Type-safe route objects defined in :api and exported to iOS via :shared
  • Centralized navigation wiring with EntryProviderInstaller in :wiring-ui
  • Parametric routes with per-route ViewModel lifecycles and unique keys
  • Metadata-based transitions for screen animations and transitions
  • Cross-feature and multi-theme navigation patterns with modular boundaries

Quick Start

Load this skill to begin configuring Navigation 3 with Navigator, EntryProviderInstaller, and typed routes across your KMP modules.

Frequently Asked Questions about kmp-navigation

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

FAQPage Schema
How do I build type-safe navigation in Kotlin Multiplatform Compose?

Type-safe Kotlin Multiplatform navigation is built using a modular Navigation 3 pattern with @Serializable route objects. You define route contracts in :api modules and wire them using Navigator and EntryProviderInstaller to ensure compile-time safety across platforms.

How does per-route ViewModel lifecycle management work in Compose Multiplatform navigation?

Per-route ViewModel lifecycle management in Compose Multiplatform navigation is handled by assigning unique keys to parametric routes. This ensures ViewModels are correctly scoped and maintained across Android, iOS, and Desktop when navigating between screens.

Can I use Koin to wire navigation routes in a Kotlin Multiplatform project?

Yes, Koin can be used to wire navigation routes in a Kotlin Multiplatform project. The architecture centralizes dependency injection in :wiring-ui modules using EntryProviderInstaller, connecting Koin-provided ViewModels to their corresponding type-safe routes.

What is the best way to handle screen transitions in Kotlin Multiplatform Compose?

The best way to handle screen transitions in Kotlin Multiplatform Compose is through metadata-based transitions. This approach attaches transition configurations directly to type-safe route objects, enabling smooth screen animations across Android, iOS, and Desktop.

How do you share navigation contracts across Android, iOS, and Desktop in Kotlin Multiplatform?

Navigation contracts are shared across Android, iOS, and Desktop in Kotlin Multiplatform by defining type-safe route objects in :api modules. These contracts are then exported to iOS via a :shared module, reducing boilerplate and platform drift.

How do I pass arguments with parametric routes in Compose Multiplatform navigation?

Passing arguments with parametric routes in Compose Multiplatform navigation requires using @Serializable route objects. This method enforces type safety for navigation arguments while managing per-route ViewModel lifecycles with unique keys.