Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-native-expo-viewport-units

joetakara1.6kMIT0.0.8

Viewport units: vw, vh, vmin, vmax - React Native.

react, react-native, react-component, react native, react-native-expo, react native expo, expo, viewport, units, vw, vh, vmin, vmax, css, style, relative, responsive, ios, android

readme

react-native-expo-viewport-units

Viewport units: vw, vh, vmin, vmax - React Native.

Install

$ npm install react-native-expo-viewport-units

or

$ yarn add react-native-expo-viewport-units

Usage

import { vw, vh, vmin, vmax } from 'react-native-expo-viewport-units';
<View style={{ width: vw(100), height: vh(100) }}>
  ...
<View>
var styles = StyleSheet.create({
  Container: {
    width: vmin(95),
    height: vmax(70),
    padding: vw(2.5),
    margin: vh(5),
  },
  Font: {
    fontSize: vw(3.75),
  },
});

License

MIT © Joe Takara