Easy Navigation For Compose Multiplatform With Voyager
Diving into Voyager’s navigation capabilities for your next Kotlin Multiplatform project
While some of the existing AndroidX libraries already have a port for Compose Multiplatform, the support for navigation is still missing. However, at the time of writing, some community-driven libraries might fill this gap.
One of these libraries is Voyager, which claims to be “A pragmatic navigation library for Jetpack Compose”.
In this article, we will walk through common navigation use cases, and we will see how we can accomplish them with Voyager as our navigation library so you can decide on your own if this library is worth a try.
1 Setup
Before we can start, make sure to add the following dependencies to your build.gradle.kts
, inside your shared
module so that we can use it in our Compose Multiplatform code. At the time of writing, we use the version 1.0.0-rc07
of the library. You can check out the latest version here.
sourceSets {
val voyagerVersion = "1.0.0-rc07"
val commonMain by getting {
dependencies {
// Used for the basic navigation
implementation("cafe.adriel.voyager:voyager-navigator:$voyagerVersion")…