@reeq/react-native-device-brightness
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

react-native-device-brightness

React-Native library which allows you to control device brightness

Installation

npm install @reeq/react-native-device-brightness

or

yarn add @reeq/react-native-device-brightness

and

cd ios/
pod install

Usage

import {
    setBrightnessLevel,
    getBrightnessLevel,
    getSystemBrightnessLevel,
    useDeviceBrightness,
    useUnmountBrightness
} from '@reeq/react-native-device-brightness';

// setting brightness
setBrightnessLevel(level: number, animated?: boolean);

// getting brightness
const brightness = await getBrightnessLevel();
console.log(brightness);

// getting system brightness (Android only)
const brightness = await getSystemBrightnessLevel();
console.log(brightness);

// just setting a brightness for the rest of app's life
useDeviceBrightness(level: number, animated?: boolean);

// setting a brightness and will restore to previous brightness on unmount
useUnmountBrightness(level: number, animated?: boolean);

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Dependencies (0)

    Dev Dependencies (20)

    Package Sidebar

    Install

    npm i @reeq/react-native-device-brightness

    Weekly Downloads

    187

    Version

    1.0.6

    License

    MIT

    Unpacked Size

    47.6 kB

    Total Files

    35

    Last publish

    Collaborators

    • reeq