react-native-viewport-ts-units
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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

Package Sidebar

Install

npm i react-native-viewport-ts-units

Weekly Downloads

4

Version

0.0.2

License

MIT

Unpacked Size

4.5 kB

Total Files

7

Last publish

Collaborators

  • rb3198