{"id":41664929,"url":"https://github.com/fopwoc/nav3ksp","last_synced_at":"2026-01-24T17:16:22.924Z","repository":{"id":324597293,"uuid":"1097778145","full_name":"fopwoc/nav3ksp","owner":"fopwoc","description":"Multiplatform codegen library for typed navigation in Navigation 3","archived":false,"fork":false,"pushed_at":"2026-01-21T18:13:01.000Z","size":867,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-22T05:36:27.528Z","etag":null,"topics":["jetpack-compose","jetpack-compose-multiplatforms","ksp","multiplatform-kotlin-library","navigation","navigation3"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fopwoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-16T20:04:31.000Z","updated_at":"2026-01-21T17:52:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fopwoc/nav3ksp","commit_stats":null,"previous_names":["fopwoc/nav3ksp"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/fopwoc/nav3ksp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fopwoc%2Fnav3ksp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fopwoc%2Fnav3ksp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fopwoc%2Fnav3ksp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fopwoc%2Fnav3ksp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fopwoc","download_url":"https://codeload.github.com/fopwoc/nav3ksp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fopwoc%2Fnav3ksp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28732317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jetpack-compose","jetpack-compose-multiplatforms","ksp","multiplatform-kotlin-library","navigation","navigation3"],"created_at":"2026-01-24T17:16:22.260Z","updated_at":"2026-01-24T17:16:22.917Z","avatar_url":"https://github.com/fopwoc.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nav3ksp\n\n[![Build](https://github.com/fopwoc/nav3ksp/actions/workflows/build.yml/badge.svg)](https://github.com/fopwoc/nav3ksp/actions/workflows/build.yml)\n![license](https://img.shields.io/github/license/fopwoc/nav3ksp)\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.fopwoc/nav3ksp?color=blue)](https://search.maven.org/search?q=g:io.github.fopwoc+nav3ksp)\n\n![badge-android](http://img.shields.io/badge/platform-android-6EDB8D.svg?style=flat)\n![badge-ios](http://img.shields.io/badge/platform-ios-CDCDCD.svg?style=flat)\n![badge-desktop](http://img.shields.io/badge/platform-desktop-DB413D.svg?style=flat)\n![badge-js-wasm](http://img.shields.io/badge/platform-js%2Fwasm-FDD835.svg?style=flat)\n\nMultiplatform codegen library for typed navigation in Navigation 3.\n\nThe library is designed to keep the same level of control that Navigation 3 gives to developers.\nIt solves the problem of writing a lot of boring and repetitive code that will link your Composable Views, typed navigation data classes, and entries to combine all of the above into NavDisplay.\n\nIt introduces several concepts:\n* **Branch** - it's basically a NavKey, a Composable component representation with all its arguments. These are used to build the BackStack for Typed navigation.\n* **Tree** - A collection of related Branches and other Trees that it includes. In collaboration with NavDisplay, it provides access to all associated Branches and subTrees via the BackStack.\n\nBy the way, this library can be used without KSP if you really like writing boilerplate by hand.\n\nSomewhat inspired by the awesome Android library [compose-destinations](https://github.com/raamcosta/compose-destinations)\n\n---\n\n## Showcase\n\nAndroid | iOS\n:-: | :-:\n\u003cvideo src=\"https://github.com/user-attachments/assets/0bf67a03-5b98-4cfa-86a3-cb16b2f94873\"/\u003e | \u003cvideo src=\"https://github.com/user-attachments/assets/343ed10b-4be5-4f0b-bedb-2b46ca5a06ae\"/\u003e\n\n---\n\n## How to install\n\nFirstly, you need to install the latest version of KSP plugin in your project.\n\n```kotlin\nplugins {\n    // ...\n    // check for the latest version here https://github.com/google/ksp/releases\n    id(\"com.google.devtools.ksp\") version \"2.3.3\" \n}\n```\n\nIn `build.gradle.kts` at the `kotlin` block of your project, add dependencies to `commonMain`\n\n```kotlin\nkotlin {\n    // ...\n    sourceSets {\n        // ...\n        commonMain {\n            kotlin.srcDir(\"build/generated/ksp/metadata/commonMain/kotlin\")\n            dependencies {\n                // ...\n                implementation(\"io.github.fopwoc:nav3ksp:1.0.1\")\n                implementation(\"io.github.fopwoc:nav3ksp-annotation:1.0.1\")\n            }\n        }\n    }    \n}\n```\n\nAdd KSP plugin dependency to the `dependencies` block.\n\n```kotlin\ndependencies {\n    // ...\n    add(\"kspCommonMainMetadata\", \"io.github.fopwoc:nav3ksp-processor:1.0.1\")\n}\n```\n\nAnd finally, add somewhere in your `build.gradle.kts` this block to run codegen on every build.\nOr not, then you have to call this job by hand.\n\n```kotlin\ntasks.named(\"preBuild\") {\n    dependsOn(\"kspCommonMainKotlinMetadata\")\n}\n```\n\n---\n\nI already said that, actually, you can use the library without any code generation, just as boilerplate \"framework\".\nIn this case, you don't need to install KSP plugin, all you have to do is add only this dependency to your `build.gradle.kts` project and have fun implementing abstract classes of all kinds.\n\n```kotlin\nsourceSets {\n    commonMain.dependencies {\n        // ...\n        implementation(\"io.github.fopwoc:nav3ksp:1.0.1\")\n    }\n}\n```\n\n---\n\n## How to use\n\nTo begin, we need to declare an annotation that will represent our Tree\n\n```kotlin\n@Tree\nannotation class RootTree\n```\n\nThen, for each View that will be part of this Tree, we must specify the Branch annotation and indicate the connection to the Tree\n\n```kotlin\n@Branch(RootTree::class)\n@Composable\nfun ExampleView() { \n    // ...\n}\n```\n\nFinally, call NavDisplay, provide it with the generated NavTreeLayout and NavTreeBuilder of your Tree, and manually specify the first screen in BackStack. Or not just one, it's vararg.\n\n```kotlin\nval LocalBackStack = compositionLocalOf\u003cNavBackStack\u003cNavKey\u003e\u003e {\n    error(\"No LocalBackStack provided\")\n}\n\n@Composable\nfun App() {\n    CompositionLocalProvider(\n        LocalBackStack provides RootNavTreeLayout.rememberTreeBackStack(RootNavTree.Example)\n    ) {\n        NavDisplay(\n            navTreeBuilder = RootNavTreeBuilder,\n            backStackLocalComposition = LocalBackStack\n        )\n    } \n}\n```\n\nThat's it! \n\n---\n\nFor more examples, you can see the 'example' module with a multiplatform app that shows a few usages of this library.\n\n1) [Simple navigation](example/composeApp/src/commonMain/kotlin/io/github/fopwoc/nav3ksp/example/01-simple.kt) - Simple navigation.\n2) [Back Handled](example/composeApp/src/commonMain/kotlin/io/github/fopwoc/nav3ksp/example/02-backhandled.kt) - Like simple navigation, but the back gesture is handled in the view.\n3) [ViewModel](example/composeApp/src/commonMain/kotlin/io/github/fopwoc/nav3ksp/example/03-viewmodel.kt) - Example of how this lib handles view models.\n4) [Arguments](example/composeApp/src/commonMain/kotlin/io/github/fopwoc/nav3ksp/example/04-arguments.kt) - Navigation with typed arguments.\n5) [Nested](example/composeApp/src/commonMain/kotlin/io/github/fopwoc/nav3ksp/example/05-nested.kt) - Nested navigation with bottom bar and 3 views. Also, an example of handing backstack from another scope.\n6) [Result](example/composeApp/src/commonMain/kotlin/io/github/fopwoc/nav3ksp/example/06-result.kt) - Navigation to form with result handling by another View.\n7) [Manual](example/composeApp/src/commonMain/kotlin/io/github/fopwoc/nav3ksp/example/07-manual.kt) - Non-KSP usage, a-ka 'Boilerplate by hand'.\n8) [Dialog](example/composeApp/src/commonMain/kotlin/io/github/fopwoc/nav3ksp/example/08-dialog.kt) - Dialog popup example via Scene and route metadata\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffopwoc%2Fnav3ksp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffopwoc%2Fnav3ksp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffopwoc%2Fnav3ksp/lists"}