Create margins and paddings in React Native in the way well known from CSS
npm install marginally-pudding





Create margins and paddings in React Native in the way well known from CSS
First, install the library in your project by npm:
``sh`
$ npm install marginally-pudding
Or Yarn:
`sh`
$ yarn add marginally-pudding
• Connect libary with project using ES6 import:
`js`
import { marginally, pudding } from 'marginally-pudding'
You can use functions with next combinations:
- (all)(vertical, horizontal)
- (top, horizontal, bottom)
- (top, right, bottom, left)
-
All params are number or string type
`jsx
import React from 'react'
import { View } from 'react-native'
import { marginally, pudding } from 'marginally-pudding'
const App = () => {
return (
backgroundColor: 'red',
...marginally(20, 10),
// marginVertical: 20,
// marginHorizontal: 10,
...pudding(0, 20, 15),
// paddingTop: 0,
// paddingHorizontal: 20,
// paddingBottom: 15,
}}
/>
)
}
``
This project is licensed under the MIT License © 2021-present Jakub Biesiada