react-native-shadow-generator
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

react-native-shadow-generator

Generate shadows for react-native android/ios in a single helper function easily!

Installation

Use the package manager npm or yarn to install react-native-shadow-generator.

yarn add react-native-shadow-generator

or

npm install react-native-shadow-generator --save

Usage

import { generateShadow } from 'react-native-shadow-generator'
 
const myStyle = {
  ...generateShadow(5) // you can pass 1 to 24
}

it will generate an object like this

myStyle = {
 shadowColor: "#000",
 shadowOffset: {
    width: 0,
    height: 2,
},
shadowOpacity: 0.25,
shadowRadius: 3.84,
elevation: 5,
}

Makes life a little bit easier!

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Package Sidebar

Install

npm i react-native-shadow-generator

Weekly Downloads

95

Version

1.1.2

License

ISC

Unpacked Size

6.15 kB

Total Files

5

Last publish

Collaborators

  • rajeshdan50