npm.io
0.0.2 • Published 6 years ago

react-native-aspect-ratio

Licence
MIT
Version
0.0.2
Deps
0
Size
2 kB
Vulns
0
Weekly
0

React Native Aspect Ratio Calculator

Usage

Import the module

import { Screen } from "react-native-aspect-ratio";
Config
Set an width/height
  // You can use in your style.
  height: Screen.setDimension(90, "h", {411, 736}), // x, y values of designed component. x: 411, y: 736
  width: Screen.setDimension(80, 'w', {411, 736}),
Get full width/height

Returns screen width and height.

  height: Screen.getDimension().height,
  width: Screen.getDimension().width,

Keywords