https://github.com/reeq-dev/react-native-device-brightness
React-Native library which allows you to change devices brightness level
https://github.com/reeq-dev/react-native-device-brightness
android ios react-native
Last synced: 6 months ago
JSON representation
React-Native library which allows you to change devices brightness level
- Host: GitHub
- URL: https://github.com/reeq-dev/react-native-device-brightness
- Owner: reeq-dev
- License: mit
- Created: 2022-11-07T21:02:13.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-11-10T11:43:13.000Z (8 months ago)
- Last Synced: 2025-11-10T13:15:23.429Z (8 months ago)
- Topics: android, ios, react-native
- Language: TypeScript
- Homepage:
- Size: 1.74 MB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# react-native-device-brightness
React-Native library which allows you to control device brightness
## Compatibility
- **v1.0.6** — compatible with both the old and the new React Native architectures
- **v2.0.0 and above** — compatible **only with the new architecture**
## Installation
```sh
npm install @reeq/react-native-device-brightness
```
or
```sh
yarn add @reeq/react-native-device-brightness
```
and
```sh
cd ios/
pod install
```
## Usage
```js
import {
setBrightnessLevel,
getBrightnessLevel,
useDeviceBrightness,
resetBrightness,
} from '@reeq/react-native-device-brightness';
/**
* setting brightness a required level
* @param level: required
*/
setBrightnessLevel(level: number);
// getting brightness
const brightness = getBrightnessLevel();
// reseting brightness
resetBrightness();
/**
* Hook sets a brightness level, will trigger each time when level is changed.
* It also releases controlling brightness when app goes into inactive/background state
* and restore when it comes back to foreground state.
* This is just a javascript implementation. You may write you own using static methods.
* @param level: required
* @param resetOnUnmount: optional. Default is false.
*/
useDeviceBrightness(level: number, resetOnUnmount?: boolean);
```
## Contributing
- [Development workflow](CONTRIBUTING.md#development-workflow)
- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
- [Code of conduct](CODE_OF_CONDUCT.md)
## License
MIT
---
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
```