@nbottarini/react-native-relative-points
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

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

Package Sidebar

Install

npm i @nbottarini/react-native-relative-points

Weekly Downloads

80

Version

0.2.0

License

MIT

Unpacked Size

6.3 kB

Total Files

8

Last publish

Collaborators

  • nbottarini