@nbottarini/react-native-relative-points
v0.2.0
Published
Utility function that eases your responsive design
Downloads
228
Maintainers
Readme
React Native relative points
Utility function that eases your responsive design
Installation
Npm:
$ npm install --save @nbottarini/react-native-relative-points
Yarn:
$ yarn add @nbottarini/react-native-relative-points
Usage
// Create a function named rv with your design width (for example the width used in Figma)
export const rv = (value) => relativeValueToPoints(value, 1440)
// Use your function to convert design units to proportional device units (the design proportions will be kept)
const MyComponent = () => (
<View style={{ paddingTop: rv(14) }} />
)