{"id":28776179,"url":"https://github.com/morfly/compose-nav3-dynamic-sample","last_synced_at":"2026-06-17T23:31:12.422Z","repository":{"id":298040258,"uuid":"998246085","full_name":"Morfly/compose-nav3-dynamic-sample","owner":"Morfly","description":"Sample app showcasing how to implement dynamic destinations with Jetpack Navigation 3","archived":false,"fork":false,"pushed_at":"2025-06-09T07:08:10.000Z","size":3345,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-04T07:32:55.447Z","etag":null,"topics":["android","compose","kotlin","navigation"],"latest_commit_sha":null,"homepage":"https://morfly.medium.com/dynamic-destinations-with-jetpack-navigation-3-41b851eef933","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Morfly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-06-08T07:25:08.000Z","updated_at":"2025-06-17T13:34:41.000Z","dependencies_parsed_at":"2025-06-09T04:36:35.073Z","dependency_job_id":"7a4a5e29-84ff-4e14-9aef-8fd0d4d25214","html_url":"https://github.com/Morfly/compose-nav3-dynamic-sample","commit_stats":null,"previous_names":["morfly/compose-nav3-dynamic-sample"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Morfly/compose-nav3-dynamic-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morfly%2Fcompose-nav3-dynamic-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morfly%2Fcompose-nav3-dynamic-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morfly%2Fcompose-nav3-dynamic-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morfly%2Fcompose-nav3-dynamic-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Morfly","download_url":"https://codeload.github.com/Morfly/compose-nav3-dynamic-sample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morfly%2Fcompose-nav3-dynamic-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34470322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["android","compose","kotlin","navigation"],"created_at":"2025-06-17T15:06:54.656Z","updated_at":"2026-06-17T23:31:12.396Z","avatar_url":"https://github.com/Morfly.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Compose Navigation 3 - Dynamic Destinations Sample\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"cover.png\" width=\"256\" height=\"auto\"\u003e\n\u003c/p\u003e\n\nThis repository contains a sample app that demonstrates how to implement dynamic destinations with [Jetpack Navigation 3](https://developer.android.com/guide/navigation/navigation-3) library.\n\nTypically, in Navigation 3 and its older version (sometimes referred to as Navigation 2), destinations are declared statically. This means all possible destinations must be specified upfront, at the moment their respective navigation container (`NavDisplay` or `NavHost`) is used in code.\n\nBut what if you don't know in advance what navigation destinations your app will have? While this is a less common use case, sometimes destinations will be known only at the moment the actual navigation happens. In this case, they must be registered dynamically, outside of the navigation graph declaration.\n\nLearn more about it in the [Dynamic destinations with Jetpack Navigation 3](https://morfly.medium.com/dynamic-destinations-with-jetpack-navigation-3-41b851eef933) blog post.\n\n## Project structure\nThis repository explores dynamic destinations in Navigation 3 and how they are compared with the more conventinal usages of the Compose Navigation library. The project includes **3** different implementations of the same navigation flow:\n\n- [**nav2/static**](app/src/main/java/io/morfly/navsample/nav2/static/NavigationV2Static.kt) — example of using the old version of Compose Navigation library with statically declared destinations.\n- [**nav3/static**](app/src/main/java/io/morfly/navsample/nav3/static/NavigationV3Static.kt) — example of using Navigation 3 with statically declared destinations.\n- [**nav3/dynamic**](app/src/main/java/io/morfly/navsample/nav3/dynamic/NavigationV3Dynamic.kt) — example of using Navigation 3 with dynamic destinations.\n\n## How to configure sample app\nYou can configure which implementation of the navigation flow to use by changing the value of the `navImplementation` variable in the [`NavigationContailer.kt`](app/src/main/java/io/morfly/navsample/NavigationContainer.kt).\n\nJust uncomment the line that points to the desired implementation and build/install the app.\n\n```kotlin\n@Composable\nfun NavigationContainer(modifier: Modifier = Modifier) {\n    // ===== Old Compose Navigation =====\n    // val navImplementation = NavImplementation.Nav2Static\n\n    // ===== Navigation 3 Static =====\n    // val navImplementation = NavImplementation.Nav3Static\n\n    // ===== Navigation 3 Dynamic =====\n    // val navImplementation = NavImplementation.Nav3Dynamic\n\n    NavigationContainer(modifier, navImplementation)\n}\n```\n\n## Demo\nThis is a simplistic Android demo app that has 3 screens and allows navigation between them including arguments.\n\n![Sample app demo](demo.png)\n\n## License\n\n```\nCopyright 2025 Pavlo Stavytskyi.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorfly%2Fcompose-nav3-dynamic-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorfly%2Fcompose-nav3-dynamic-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorfly%2Fcompose-nav3-dynamic-sample/lists"}