Masked View Component for React. Just like a <View /> with a mask.
<MaskedView maskImage="mask.png">...</MaskedView>
0.2.0is compatible with [email protected]0.1.0is compatible with [email protected]
npm install react-native-masked-viewvar MaskedView = require('react-native-masked-view');
... then have a look at these instructions and adjust accordingly.
maskImage: File name of image asset added to Images.xcassets. See React Docs for instructions on adding images.
note: since [email protected] the MaskedView element cannot have it's own backgroundColor, but it's children can.
Just clone this repo, cd into react-native-masked-view and npm install. Then open MaskedViewDemo.xcodeproj and click run.
- add more sizing options
- add various mask sources: shape, svg, other layers
- replace
maskImageprop withmaskSourceprop that works just like<Image />'ssourceprop. (the internal react-native image-related code really should be refactored so it's more easily re-usable outside of<Image />)
