0.0.2 • Published 1 year ago

react-native-viewport-ts-units v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-native-viewport-ts-units

A simple package enabling vw, vh, vmin, vmax units for measurement in React Native. TypeScript Declarations included.

Install

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

or

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

Usage

Simply call the functions to size your components.

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

License

MIT © Ronit Bhatia