Skip to content

Small library that helps you to get status bar height, P.S 📱X supported ❤️

License

Notifications You must be signed in to change notification settings

devym-37/react-native-safearea-height

 
 

Repository files navigation

ovr Fork Version

Original https://github.com/ovr/react-native-status-bar-height

react-native-safearea-height

Small library that helps you to get status bar height

P.S :iPhone:X / iPhone 12 / iPhone 14Pro supported ❤️

Install

$ npm install --save react-native-safearea-height
# OR
$ yarn add react-native-safearea-height

Usage getStatusBarHeight(skipAndroid: boolean = false)

import { getStatusBarHeight } from "react-native-safearea-height";

// 59 - iPhone 14 Pro / 14Pro Max / 15 series
// 47 - iPhone 12 / 12Pro / 13 / 13Pro / 13Pro Max / 14 / 14 Plus
// 44 - on iPhoneX
// 20 - on iOS device
// X - on Android platfrom (runtime value)
// 0 - on all other platforms (default)

console.log(getStatusBarHeight());

// will be 0 on Android, because You pass true to skipAndroid
console.log(getStatusBarHeight(true));

reference safeArea size url

License

This project is open-sourced software licensed under the MIT License.

See the LICENSE file for more information.

About

Small library that helps you to get status bar height, P.S 📱X supported ❤️

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 62.7%
  • JavaScript 37.3%