{"id":19165004,"url":"https://github.com/vonovak/react-native-theme-control","last_synced_at":"2025-04-12T14:56:38.840Z","repository":{"id":37554950,"uuid":"505966164","full_name":"vonovak/react-native-theme-control","owner":"vonovak","description":"Natively control react native application theme at runtime and persist it for the next app start.","archived":false,"fork":false,"pushed_at":"2024-10-29T18:46:32.000Z","size":2130,"stargazers_count":155,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-29T20:38:26.289Z","etag":null,"topics":["apearance","dark","dark-mode","hacktoberfest","react-native","theme"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/vonovak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["vonovak"]}},"created_at":"2022-06-21T18:48:40.000Z","updated_at":"2024-10-29T18:46:34.000Z","dependencies_parsed_at":"2023-01-16T15:16:52.297Z","dependency_job_id":"b8c85291-361a-4d2c-8374-3e208ee85755","html_url":"https://github.com/vonovak/react-native-theme-control","commit_stats":null,"previous_names":["vonovak-org/react-native-theme-control","vonovak/react-native-theme-control"],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonovak%2Freact-native-theme-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonovak%2Freact-native-theme-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonovak%2Freact-native-theme-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vonovak%2Freact-native-theme-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vonovak","download_url":"https://codeload.github.com/vonovak/react-native-theme-control/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586248,"owners_count":21128996,"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":["apearance","dark","dark-mode","hacktoberfest","react-native","theme"],"created_at":"2024-11-09T09:26:02.252Z","updated_at":"2025-04-12T14:56:38.819Z","avatar_url":"https://github.com/vonovak.png","language":"TypeScript","funding_links":["https://github.com/sponsors/vonovak","https://github.com/sponsors/vonovak?frequency=one-time\u0026sponsor=vonovak"],"categories":[],"sub_categories":[],"readme":"# react-native-theme-control\n\nControl the native platform theme from React Native.\n\n✅ Control theme of RN Views, as well as native UI controls (alerts, native menus, date pickers... on both Android and iOS)\n\n✅ Recover the previously set theme upon app startup, and **apply it before your app starts rendering**\n\n✅ Control the color of the UIApplication Window (iOS) and the current Activity (Android) using [`AppBackground`](https://github.com/vonovak-org/react-native-theme-control/blob/main/docs/readme-internal.md#appbackground)\n\n✅ Supports Expo via a config plugin\n\n✅ [New Architecture](https://reactnative.dev/docs/the-new-architecture/landing-page) supported\n\nAdditionally, provides functionality to control the appearance (background and border color, light / dark buttons) of the Android navbar.\n\nThe package is tested with RN \u003e= 0.66.1 (last tested with RN 74, Expo 51). See [RN version support](docs/install.md).\n\n### Example\n\nNotice the color of scroll bar and keyboard in the screenshots below.\n\n| light mode                | dark mode               | application background in modal    |\n| ------------------------- | ----------------------- |------------------------------------|\n| ![light](./img/light.png) | ![dark](./img/dark.png) | ![app background](./img/modal.png) |\n\n## Motivation\n\nThe use case for the package is explained in a [youtube video](https://youtu.be/NNYQj_T0Sf8).\n\nIn React Native, you can use the `useColorScheme()` hook, or other functions from the `Appearance` API to get information about the system theme.\n\nNote: as of RN 72, the following paragraph isn't true anymore (there is `setColorScheme` now). However, RN does not maintain the selected color scheme across restarts and doesn't contain other goodies in this package.\n\nUsing that information, you can then render your Views in dark or light mode design. However, that information is read-only: you cannot influence what the `useColorScheme()` hook returns. What if you want to allow the user to choose the application theme? React Native core does not directly expose the APIs to do so.\n\nYou might follow one of the many blog posts for theming React Native apps such as [here](https://blog.logrocket.com/comprehensive-guide-dark-mode-react-native/#dark-mode-react-native-using-context-api) or [here](https://medium.com/@ratebseirawan/react-native-dark-mode-done-right-13f83b39a4ca). The approach taken by the guides is to store the application theme in the JavaScript part of your app. However, this can easily leave your users with a broken experience because while the React Native views will be rendered correctly, the native views (Alert, Document picker, Date picker, Menu...) will not.\n\nThis package provides a solution to change the application theme so that both react native and native components use the same theme - see the [relevant part of the video](https://youtu.be/NNYQj_T0Sf8?t=73).\n\n## Documentation\n\nInstallation and usage instructions can be found [here](./docs/install.md).\n\nThe library api is documented in detail [here](./docs/readme-internal.md).\n\nMore usage examples can be found [in the example project](./example).\n\n### Say thanks\n\nIf you find the package useful, consider giving a star to the repository or [sponsoring](https://github.com/sponsors/vonovak?frequency=one-time\u0026sponsor=vonovak).\n\n### Credits\n\nSome naming inspiration for the Android Navbar components was taken from [react-native-bars](https://github.com/zoontek/react-native-bars).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvonovak%2Freact-native-theme-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvonovak%2Freact-native-theme-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvonovak%2Freact-native-theme-control/lists"}