React Native Shadow Generator is a tool to quickly generate your shadow's Components. Tool builded by .mind team.
npm install @dotmind/rn-shadow-generator
React Native Shadow Generator to quickly generate shadow of your components. Builded by .mind.io
- Menu
- ๐ Roadmap
- ๐ Preview
- ๐ป Installation
- ๐ทโโ๏ธ How it's work
- ShadowView usage
- generateShadow usage
- ๐งช Example app
- โก๏ธ Contributing
- ๐ License
* [ ] Android full compatibility (shadowOffset support)
``bash`
yarn add @dotmind/rn-shadow-generator
or
`bash`
npm i @dotmind/rn-shadow-generator --save
`javascript
import { ShadowView } from '@dotmind/rn-shadow-generator';
const BasicComponent = () =>ย {
return (
);
}
const MyCustomComponent = () =>ย {
return (
);
}
`
| props | description | required | default value |
|-|-|-|-|
| level | Increase shadow dimensions | false | 4 |
| shadowColor | Change shadowColor style attribute | false | #000 |
| direction | Change shadow direction | false | bottom |
Returns a full shadow object depending on OS (iOS or Android).
`javascript
import { generateShadow } from '@dotmind/rn-shadow-generator';
const BasicComponent = () =>ย {
return (
);
}
const MyCustomComponent = () =>ย {
return (
);
}
`
| attributes | description | required | default value |
|-|-|-|-|
| level | Increase shadow dimensions | false | 4 |
| shadowColor | Change shadowColor style attribute | false | #000 |
| direction | Change shadow direction | false | bottom |
Object returned
`javascript`
{
...Platform.select({
ios: {
shadowColor,
shadowOffset,
shadowOpacity,
shadowRadius,
},
android: {
shadowColor,
elevation: level,
},
}),
}
To see full app integration example please refer to here.
> โ ๏ธ To run the app please run here yarn build` that the @dotmind/rn-shadow-generator npm package be able to link itselfs.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.