{"id":20187249,"url":"https://github.com/ramilushev/react-native-background-color","last_synced_at":"2025-09-04T07:15:38.672Z","repository":{"id":48936529,"uuid":"86675888","full_name":"ramilushev/react-native-background-color","owner":"ramilushev","description":"Set the root app background color from JavaScript","archived":false,"fork":false,"pushed_at":"2021-07-04T21:31:30.000Z","size":25332,"stargazers_count":18,"open_issues_count":4,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T06:45:06.220Z","etag":null,"topics":["react-native"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ramilushev.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}},"created_at":"2017-03-30T08:04:14.000Z","updated_at":"2025-01-07T15:28:42.000Z","dependencies_parsed_at":"2022-09-08T11:50:47.015Z","dependency_job_id":null,"html_url":"https://github.com/ramilushev/react-native-background-color","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ramilushev/react-native-background-color","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramilushev%2Freact-native-background-color","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramilushev%2Freact-native-background-color/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramilushev%2Freact-native-background-color/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramilushev%2Freact-native-background-color/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramilushev","download_url":"https://codeload.github.com/ramilushev/react-native-background-color/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramilushev%2Freact-native-background-color/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265076115,"owners_count":23707512,"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":["react-native"],"created_at":"2024-11-14T03:22:21.732Z","updated_at":"2025-07-20T21:36:20.267Z","avatar_url":"https://github.com/ramilushev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## React Native Background Color\n  This module alows you to set the root backgound color of your react-native app from JS.\n  \n  This calls `setBackgroundColor` on the root view, which overwrites/removes any existing background resource, including any borders, corners, padding, etc. This is very good for if you set a splash screen in Android following this popular way - [Medium :: Andrey Nikishaev - Change splash screen in React Native Android app](https://medium.com/react-native-development/change-splash-screen-in-react-native-android-app-74e6622d699). That tutorial recommends setting a solid color on the root view to just cover the splash image. However when the keyboard shows, it shows the background view for a split second, and your splash image is visible. So by using `setBackgroundColor` from this module, you can erase that image from the back.\n\n**Supports only Android at the moment.**\n\n### Workaround for iOS\n  You can set the color of the root view directly in the `AppDelegate.m` file, in the `didFinishLaunchingWithOptions` function\n  ```objective-c\n  didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n    // ...\n    \n    RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation\n                                                        moduleName:@\"proquantMobile\"\n                                                 initialProperties:nil\n                                                     launchOptions:launchOptions]; \u003c--- after this line\n    \n    // adjust red, green, blue and alpha as per the UIColor spec\n    rootView.backgroundColor = [[UIColor alloc] initWithRed:0.23f green:0.25f blue:0.82f alpha:1.0];\n    \n    // ...\n  }\n  ```\n  \n  \n\n### Installation\n\n#### Using npm:\n\n```sh\n$ npm install --save react-native-background-color\n```\n\n#### Using yarn:\n\n```sh\n$ yarn add react-native-background-color\n```\n\n#### Link module\n\n```sh\n$ react-native link\n```\n\n### Usage\n\n```jsx\nimport React, { Component } from 'react';\n\nimport BackgroundColor from 'react-native-background-color';\n\nexport default class App extends Component {\n  componentDidMount() {\n    BackgroundColor.setColor('#FFFFFF');\n  }\n\n  render() {\n    return (\n      \u003cView/\u003e\n    );\n  }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framilushev%2Freact-native-background-color","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framilushev%2Freact-native-background-color","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framilushev%2Freact-native-background-color/lists"}