Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gilbox/react-native-masked-view

Masked View Component for React
https://github.com/gilbox/react-native-masked-view

Last synced: about 1 month ago
JSON representation

Masked View Component for React

Awesome Lists containing this project

README

        

# react-native-masked-view

Masked View Component for React. Just like a `` with a mask.

...

![screen shot](https://github.com/gilbox/react-native-masked-view/raw/master/masked-view-screenshot.png)

## compatibility

- `0.2.0` is compatible with [email protected]
- `0.1.0` is compatible with [email protected]

## installation

- `npm install react-native-masked-view`
- `var MaskedView = require('react-native-masked-view');`

... then have a look at [these instructions](https://github.com/chirag04/react-native-dashed-border)
and adjust accordingly.

## options

- `maskImage`: File name of image asset added to Images.xcassets.
[See React Docs for instructions on adding images.](https://facebook.github.io/react-native/docs/image.html#adding-static-resources-to-your-app-using-images-xcassets)

**note**: since [email protected] the MaskedView element cannot have it's own backgroundColor, but it's children can.

## demo

Just clone this repo, `cd` into `react-native-masked-view` and `npm install`. Then open `MaskedViewDemo.xcodeproj` and click run.

## todo

- add more sizing options
- add various mask sources: shape, svg, other layers
- replace `maskImage` prop with `maskSource` prop that works just like ``'s `source` prop.
(the internal react-native image-related code really should be refactored so it's more easily
re-usable outside of ``)