Skip to content


A small and simple, yet fully fledged and customizable navigation library for Jetpack Compose:

  • Full type-safety
  • State restoration
  • Nested navigation with independent backstacks
  • Easy integration with BottomNavigation and TabRow
  • Own lifecycle, saved state and view models for every backstack entry
  • Animated transitions
  • Navigation logic may be easily moved to the ViewModel layer
  • No builders, no obligatory superclasses for your composables

Quick start

Add a single dependency to your project:


Define a set of screens. It is convenient to use a sealed class for this:

sealed class Screen : Parcelable {

    object First : Screen()

    data class Second(val id: Int) : Screen()

    data class Third(val text: String) : Screen()


Create a composable with NavController, NavBackHandler and NavHost:

fun NavHostScreen() {
    val navController = rememberNavController<Screen>(
        startDestination = Screen.First


    NavHost(navController) { screen ->
        when (screen) {
            Screen.First -> Column {
                Text("First screen")
                Button(onClick = {
                    navController.navigate(Screen.Second(id = 42))
                }) {
                    Text("To Second screen")

            is Screen.Second -> Column {
                Text("Second screen: ${}")
                Button(onClick = {
                    navController.navigate(Screen.Third(text = "Hello"))
                }) {
                    Text("To Third screen")

            is Screen.Third -> {
                Text("Third screen: ${screen.text}")

As you can see, NavController is used for switching between screens, NavBackHandler handles back presses and NavHost provides a composable corresponding to the last destination in the backstack. As simple as that.