1.0.0 • Published 3 years ago

react-native-pixelperfact v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

React Native pixel Perfact screens

npm i react-native-pixerperfact is a small library that provides 3 simple methods so that React Native developers can code their UI elements fully responsive. No media queries needed.

It also provides an optional third method for screen orientation detection and automatic rerendering according to new dimensions.

Give it a try and make your life simpler!

Getting Started

Dependencies

  • react-native-device-info

Installing

  • First, install our library | use below npm script.
npm i react-native-pixelperfact react-native-device-info
yarn add react-native-pixelperfact react-native-device-info
  • Any modifications needed to be made to files/folders
  • Well-done.

Demo

  • Ios and Android Demo is there.

example

code

1. add below import in your code :

import {getFontSize, getHeight, getWidth} from 'react-native-pixelperfact';

3. Use These Function such as these below examples :

 <View
   style={{
     height: getHeight(10),
     width: getWidth(40),
     backgroundColor: 'red',
  }}>
   <Text style={{fontSize: getFontSize(2.5)}}>ANY SAMPLE TEXT</Text>
 </View>

Executing program

  • Just run your program
npm run ios && npm run android
react-native run-ios && react-native run-android

Props

PropsValue TypeDescription
getHeightNumberits return a responsive height acording to screen dimension
getWidthNumberits return a responsive width acording to screen dimension.
getFontSizeNumberits return a responsive fontsize acording to screen dimension.

Help

Any advise for common problems or issues.

  • just email or whatsapp
ranazainamin.developer@gmail.com
+923051522429

Authors

Contributors names and contact info

ex. Rana zain amin

License

This project is licensed under the Rana zain License - see the LICENSE.md file for details