Member-only story

Compose Destinations — Navigation Library

How to convert your Jetpack Compose navigation app to use Compose Destinations Library to get rid of boilerplate code?

Vincent Tsen
3 min readMay 21, 2022

This is part of the Jetpack Compose navigation series:

In my previous post, I build a very simple Jetpack Compose Navigation and use the NavRoute sealed class to avoid hard coding strings in multiple places.

However, a better solution may be just using this awesome Compose Destinations library! Let’s see how we can convert this app to use this library.

Setup build.gradle (module level)

1. Add KSP Plugin

Add com.google.devtools.ksp plugin

plugins {
...
id 'com.google.devtools.ksp' version '1.6.10-1.0.2'
}

2. Add Generated KSP Path

--

--

Responses (3)