npm.io
0.2.0 • Published 2 years ago

@nbottarini/react-native-relative-points

Licence
MIT
Version
0.2.0
Deps
1
Size
6 kB
Vulns
0
Weekly
0
Stars
2

npm License: MIT CI Status

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) }} />    
)

Keywords