{"id":13610661,"url":"https://github.com/lukwol/navigation","last_synced_at":"2025-04-13T01:32:09.675Z","repository":{"id":62844025,"uuid":"562428336","full_name":"lukwol/navigation","owner":"lukwol","description":"Simple navigation in Compose Multiplatform apps","archived":true,"fork":false,"pushed_at":"2024-03-15T21:17:42.000Z","size":793,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-01T19:55:28.459Z","etag":null,"topics":["android","compose","desktop","ios","kotlin","multiplatform","navigation","web"],"latest_commit_sha":null,"homepage":"https://lukwol.github.io/navigation","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/lukwol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2022-11-06T10:33:22.000Z","updated_at":"2024-07-12T09:26:30.000Z","dependencies_parsed_at":"2024-02-01T10:30:39.368Z","dependency_job_id":"3c11521a-9500-4865-8694-d412418a1ef9","html_url":"https://github.com/lukwol/navigation","commit_stats":null,"previous_names":["lukwol/cmnav","lukwol/navigation"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukwol%2Fnavigation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukwol%2Fnavigation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukwol%2Fnavigation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukwol%2Fnavigation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukwol","download_url":"https://codeload.github.com/lukwol/navigation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223558244,"owners_count":17165095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","desktop","ios","kotlin","multiplatform","navigation","web"],"created_at":"2024-08-01T19:01:46.838Z","updated_at":"2024-11-07T17:30:19.987Z","avatar_url":"https://github.com/lukwol.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# navigation\n\n[![maven-central](https://img.shields.io/badge/Maven-Central-download.svg?style=flat-square)](https://central.sonatype.com/namespace/io.github.lukwol)\n[![check](https://github.com/lukwol/navigation/actions/workflows/check.yml/badge.svg)](https://github.com/lukwol/navigation/actions/workflows/check.yml)\n\nTiny library for easy navigation\nin [Compose Multiplatform](https://github.com/JetBrains/compose-jb/)\napplications.\n\nProvides:\n\n* Screens navigation - multiplatform\n* Optional `ViewModel` with work cancellation support - multiplatform\n* Windows navigation - desktop only\n\n## Versions\n\nFor each version of `navigation` specific version of Compose Multiplatform is required\n\n| navigation | compose-multiplatform |\n|:----------:|:---------------------:|\n|   1.4.0    |         1.6.1         |\n|   1.3.2    |        1.5.12         |\n|   1.3.1    |        1.5.11         |\n|   1.3.0    |        1.5.10         |\n|   1.2.0    |         1.5.3         |\n|   1.1.0    |         1.5.2         |\n|   1.0.0    |         1.5.1         |\n\n## Installation\n\nAdd `mavenCentral` and `google` repositories:\n\n```kotlin\nrepositories {\n    mavenCentral()\n    google()\n}\n```\n\nDeclare dependencies in `build.gradle.kts`:\n\n```kotlin\ndependencies {\n    // Screens navigation - multiplatform\n    implementation(\"io.github.lukwol:navigation-screens:1.4.0\")\n    // Screens navigation with ViewModel support - multiplatform\n    implementation(\"io.github.lukwol:navigation-screens-viewmodel:1.4.0\")\n    // Windows navigation - desktop application only\n    implementation(\"io.github.lukwol:navigation-windows:1.4.0\")\n}\n```\n\n## Usage\n\nBootstrap new project with handy [`app-template`](https://github.com/lukwol/app-template/).\n\n### Build screens navigation\n\nBasic screens navigation:\n\n```kotlin\nScreensNavigation(\n    startRoute = AppRoutes.FirstScreenRoute,\n) {\n    screen(AppRoutes.FirstScreenRoute) {\n        FirstScreen()\n    }\n\n    screen(AppRoutes.SecondScreenRoute) { args: String? -\u003e\n        SecondScreen(args)\n    }\n}\n```\n\nScreens navigation with `ViewModel` and custom animations:\n\n```kotlin\nScreensNavigation(\n    startRoute = AppRoutes.FirstScreenRoute,\n    enterTransition = {\n        slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Left)\n    },\n    exitTransition = {\n        slideOutOfContainer(AnimatedContentTransitionScope.SlideDirection.Left)\n    },\n    popEnterTransition = {\n        slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Right)\n    },\n    popExitTransition = {\n        slideOutOfContainer(AnimatedContentTransitionScope.SlideDirection.Right)\n    },\n) {\n    screen(\n        route = AppRoutes.FirstScreenRoute,\n        viewModelFactory = {\n            FirstScreenViewModel()\n        }\n    ) { viewModel -\u003e\n        FirstScreen(viewModel)\n    }\n\n    screen(\n        route = AppRoutes.SecondScreenRoute,\n        viewModelWithArgs = { args: SomeArgs? -\u003e\n            SecondScreenViewModel(args)\n        }\n    ) { viewModel -\u003e\n        SecondScreen(viewModel)\n    }\n}\n```\n\n### Build windows navigation if needed (desktop)\n\n```kotlin\nWindowsNavigation(\n    startRoute = AppRoutes.FirstWindowRoute\n) {\n    window(\n        route = AppRoutes.FirstWindowRoute,\n        title = \"First Window\"\n    ) {\n        ScreensNavigation(\n            startRoute = AppRoutes.FirstScreenRoute\n        ) {\n            // ...\n        }\n    }\n\n    window(\n        route = AppRoutes.SecondWindowRoute,\n        title = \"Second Window\"\n    ) {\n        ScreensNavigation(\n            startRoute = AppRoutes.SecondScreenRoute\n        ) {\n            // ...\n        }\n    }\n}\n```\n\n### Navigate to screen\n\n```kotlin\n// Obtain LocalScreensController in your view\nval screensController = LocalScreensController.current\n\n// Push screen\nscreensController.push(AppRoutes.SecondScreenRoute)\n\n// Optionally pass arguments if needed\nscreensController.push(AppRoutes.SecondScreenRoute, SomeArguments)\n\n// Pop screen to navigate back\nscreensController.pop()\n\n// Optionally pass route, up to which screens should be dismissed\nscreensController.pop(AppRoutes.FirstScreenRoute)\n```\n\n### Navigate to window (desktop)\n\n```kotlin\n// Obtain LocalWindowController in your view\nval windowsController = LocalWindowController.current\n\n// Open window\nwindowsController.open(AppRoutes.SecondWindowRoute)\n\n// Optionally pass arguments if needed\nwindowsController.open(AppRoutes.SecondWindowRoute, SomeArguments)\n\n// Close window\nwindowsController.close(AppRoutes.SecondWindowRoute)\n```\n\n## Documentation\n\nAPI Reference is available at https://lukwol.github.io/navigation/\n\n## Licensing\n\nProject is available under [MIT](https://github.com/lukwol/navigation/blob/main/LICENSE) License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukwol%2Fnavigation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukwol%2Fnavigation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukwol%2Fnavigation/lists"}