1.0.3 • Published 4 months ago

react-native-brightness-control v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

🔅 react-native-brightness-control

Native module for RN that allows you to control screen brightness

npm

Installation

npm install react-native-brightness-control

# or

yarn add react-native-brightness-control

Features

  • Adjust screen brightness
  • Brightness transition animation
  • Restore initial user brightness when app goes to background (iOS only)

Usage

import Brightness from 'react-native-brightness-control';

// Get current screen brightness
const brightness = await Brightness.getBrightness();

// Set screen brightness
Brightness.setBrightness(0.8); // Set brightness to 80%

// Set screen brightness with animation
Brightness.setBrightness(0.5, 500); // Animate brightness to 50% over 500ms

// Restore initial user brightness when app goes to background (iOS only)
// Initial value is "true"
Brightness.setIsNeedRestoreBrightness(true);

License

MIT License

1.0.3

4 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago

0.1.0

5 months ago