{"id":18859881,"url":"https://github.com/kashif-e/voyant","last_synced_at":"2025-04-14T12:20:40.975Z","repository":{"id":261408279,"uuid":"864502574","full_name":"Kashif-E/Voyant","owner":"Kashif-E","description":"An extension library for voyager and Navigation Compose  to use native iOS navigation from  Compose multiplatform","archived":false,"fork":false,"pushed_at":"2025-01-03T09:38:23.000Z","size":2638,"stargazers_count":52,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T01:26:11.552Z","etag":null,"topics":["compose-multiplatform","hacktoberfest","jetpack-compose","kotlin-library","kotlin-multiplatform","navigation-component","voyager-navigation"],"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/Kashif-E.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":"2024-09-28T11:47:51.000Z","updated_at":"2025-03-05T00:17:20.000Z","dependencies_parsed_at":"2025-01-03T10:37:28.724Z","dependency_job_id":null,"html_url":"https://github.com/Kashif-E/Voyant","commit_stats":null,"previous_names":["kashif-e/voyant"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kashif-E%2FVoyant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kashif-E%2FVoyant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kashif-E%2FVoyant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kashif-E%2FVoyant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kashif-E","download_url":"https://codeload.github.com/Kashif-E/Voyant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248877968,"owners_count":21176244,"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":["compose-multiplatform","hacktoberfest","jetpack-compose","kotlin-library","kotlin-multiplatform","navigation-component","voyager-navigation"],"created_at":"2024-11-08T04:19:35.410Z","updated_at":"2025-04-14T12:20:40.965Z","avatar_url":"https://github.com/Kashif-E.png","language":"Kotlin","funding_links":["https://www.buymeacoffee.com/kashifmehmood","https://img.buymeacoffee.com/button-api/?text=Buy"],"categories":[],"sub_categories":[],"readme":"\n# Voyant\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://github.com/Kashif-E/Voyant/releases/tag/0.0.1\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/release/kashif-e/voyant\" alt=\"Version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://mailchi.mp/kotlinweekly/kotlin-weekly-427\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Kotlin%20Weekly-427-blue\" alt=\"Kotlin Weekly\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Overview\n\n **Voyant** is an extension library for **Voyager** and **Jetpack Compose Navigation** it enables developers to use native navigation for **Apple** platforms.\n\n## Demo\n\n\u003cimg src=\"art/demo.gif\" width=\"300\" height=\"650\" /\u003e\n\n***Like What you see?***\n\n**Buy me a coffee**\n\n\u003ca href=\"https://www.buymeacoffee.com/kashifmehmood\"\u003e\u003cimg src=\"https://img.buymeacoffee.com/button-api/?text=Buy me a coffee\u0026emoji=\u0026slug=kashifmehmood\u0026button_colour=FFDD00\u0026font_colour=000000\u0026font_family=Cookie\u0026outline_colour=000000\u0026coffee_colour=ffffff\" /\u003e\u003c/a\u003e\n\n\n## Installation\n\n- For Voyager\n\n```Kotlin  \nimplementation(\"io.github.kashif-mehmood-km:voyant-voyagerx:latest\")  \n```  \n- For compose Navigation\n\n```Kotlin\nimplementation(\"io.github.kashif-mehmood-km:voyant-navigation-compose:latest\") \n```\n\n## Swift UI\n\n- For Swift UI there is one small extra step\n\n```Swift\n\n\nstruct NavigationControllerWrapper: UIViewControllerRepresentable {\n\n    func makeUIViewController(context: Context) -\u003e UINavigationController {\n        // MainKt.MainViewController() is the entry point of the app wrapped inside a uinavigation controller\n        //so you can get the navigation controller from the view controller\n        let navigationController = UINavigationController(rootViewController: MainKt.MainViewController())\n        navigationController.interactivePopGestureRecognizer?.isEnabled = true\n        return navigationController\n    }\n\n    func updateUIViewController(_ uiViewController: UINavigationController, context: Context) {\n    \n    }\n}\n// content view being used inside AppDelegate to set the root view controller\nstruct ContentView: View {\n    var body: some View {\n        NavigationControllerWrapper()\n            .edgesIgnoringSafeArea(.all)\n    }\n}\n\n```\n\n\n## Supported Platforms\n\n- Android\n- IOS\n- WasmJS\n- JVM\n\n## Usage\n\n**Voyager**\n\n```Kotlin\n@Composable\n@OptIn(ExperimentalMaterialApi::class)\nfun VoyagerNavigation() {\n  Voyant(\n    content = { BottomSheetNavigator { Navigator(ScreenA()) } },\n    wrapper = { content -\u003e AppTheme { content() } })\n}\n```\n\n- `Voyant` is the entry point for the library, it takes two parameters `content` and `wrapper`\n  where `content` is the main content of the app and `wrapper` is the wrapper around the content.\n  Pass the `Navigator` as the content and `BottomSheetNavigator` as the wrapper.\n- Instead of using methods of voyager library like `push` use `pushX` instead. Similar\n  for `BottomSheetNavigator` use `showX` instead of `show`\n- ```Kotlin\n  fun BottomSheetNavigator.showX(\n    screen: Screen,\n    skipHalfExpanded: Boolean = false,\n    fixedHeight: Double = 0.0\n  )\n  ```\n  showX has two extra parameters `skipHalfExpanded` and `fixedHeight` which are optional and can be used to skip the half expanded state and set the fixed height of the bottom sheet respectively for IOS.\n\n**Navigation Compose**\n\nInherit your screens from this `VoyantRoute` interface\n\n```Kotlin\ninterface VoyantRoute{\n    @Composable\n    fun content(navController: NavController)\n}\n```\ncreate your screens like this\n\n```kotlin\n@Serializable\nobject MovieScreenRoute : VoyantRoute {\n    @Composable\n    override fun content(navController: NavController) {\n       \n        Box(modifier = Modifier.fillMaxSize()) {\n            Text(\n                \"Movie Screen\",\n                modifier = Modifier.padding(16.dp).align(Alignment.Center).clickable {\n                    navController.navigateX(MovieDetailsScreenRoute)\n                })\n        }\n    }\n}\n```\ndefine the navgraph and use the serialized version of routes and get them from back stack entry\n\n```Kotlin\n@Composable\nfun NavigationCompose() {\n    Voyant(content = {\n        val navController = rememberNavController()\n        NavHost(navController = navController, startDestination = MovieScreenRoute) {\n            composable\u003cMovieScreenRoute\u003e { backStackEntry -\u003e\n                val searchDomainModel = backStackEntry.toRoute\u003cMovieScreenRoute\u003e()\n                searchDomainModel.content(navController)\n            }\n            composable\u003cMovieDetailsScreenRoute\u003e { navBackStackEntry -\u003e\n                val movieDetailsScreenRoute =\n                    navBackStackEntry.toRoute\u003cMovieDetailsScreenRoute\u003e()\n                movieDetailsScreenRoute.content(navController)\n            }\n        }\n\n    }, wrapper = { content -\u003e\n        AppTheme {\n            content()\n        }\n    })\n}\n\n```\n\n- Use the Voyant function to wrap the `NavHost` and `AppTheme` or any other wrapper such as koinApplication.\n- Pass the `NavHost` as the content and `AppTheme` or any other wrapper as the wrapper.\n\n\nYou can check the `composeApp` for more details on both `navigation compose` and `voyager` usage.\n\nThe library is in an experimental stage, APIs can change/break.\n\n\n**Contributions**\n\nContributions are Welcome! Before submitting a pull request, please open an issue so we can discuss the proposed changes and collaborate on improving the project.\n\n**Feature Requests**\nFeature requests are encouraged, and I’ll do my best to address them as quickly as possible.\n\n\n## License\n\n```  \nMIT License  \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkashif-e%2Fvoyant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkashif-e%2Fvoyant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkashif-e%2Fvoyant/lists"}