https://github.com/robinpowered/react-native-screen-brightness
Screen brightness module for iOS & Android on React Native
https://github.com/robinpowered/react-native-screen-brightness
Last synced: about 1 year ago
JSON representation
Screen brightness module for iOS & Android on React Native
- Host: GitHub
- URL: https://github.com/robinpowered/react-native-screen-brightness
- Owner: robinpowered
- Created: 2015-12-07T21:52:42.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-09-02T06:01:49.000Z (over 2 years ago)
- Last Synced: 2025-03-24T04:43:39.569Z (about 1 year ago)
- Language: Java
- Size: 91.8 KB
- Stars: 94
- Watchers: 28
- Forks: 67
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-screen-brightness
Access and update the system brightness on a device.
## React Native compatibility
| React Native version | Compatible `react-native-screen-brightness` version |
| :------------------: | :------------------: |
| v0.60+ | v2.x |
| v0.27 - v0.59 | v1.x |
## Install
Install with [yarn](https://yarnpkg.com) or [npm](https://www.npmjs.com).
```shell
yarn add react-native-screen-brightness
```
```shell
npm i --save react-native-screen-brightness
```
## Example
```js
import ScreenBrightness from 'react-native-screen-brightness';
ScreenBrightness.setBrightness(0.5); // between 0 and 1
ScreenBrightness.getBrightness().then(brightness => {
console.log('brightness', brightness);
});
```