Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/voronianski/react-native-effects-view

Use iOS8 UIVisualEffectViews's blur and vibrancy with ReactNative
https://github.com/voronianski/react-native-effects-view

Last synced: about 1 month ago
JSON representation

Use iOS8 UIVisualEffectViews's blur and vibrancy with ReactNative

Awesome Lists containing this project

README

        

# ReactNativeEffectsView

[![npm version](http://badge.fury.io/js/react-native-effects-view.svg)](http://badge.fury.io/js/react-native-effects-view)

> Component to make easy use of iOS8 `UIVisualEffectViews` with `UIBlurEffect` and `UIVibrancyEffect` in [ReactNative](http://facebook.github.io/react-native).

Screenshot

## Install

```bash
npm install react-native-effects-view --save
```

- In XCode right click on project's name and choose `Add Files to..`
- Go to `node_modules/react-native-effects-view` and select `DVEffects` folder
- Now you're ready to `require('react-native-effects-view')` inside your app!

## Props

- `blurStyle` _(String)_ - choose one of the following:
- `"light"` (_default_)
- `"extraLight"`
- `"dark"`
- `vibrantContent` _(ReactElement)_ - render vibrant content inside blurred view.

## Children

All children of `` will be blurred, however you can use it without children and position element on top of background images and other views.

## Example

In order to see usage example check [`example/EffectsApp`](https://github.com/voronianski/react-native-effects-view/tree/master/example/EffectsApp) folder in XCode (don't forget to run `npm install` inside). It contains the app presented by [screenshot](https://raw.githubusercontent.com/voronianski/react-native-effects-view/master/example/UIVisualEffects.png).

```javascript
var React = require('react-native');
var EffectsView = require('react-native-effects-view');
var { AppRegistry, StyleSheet, View } = React;

var App = React.createClass({
renderVibrant() {
return (

Do you feel blurry??

);
},

render() {
return (



);
}
});

var styles = StyleSheet.create({
bg: {
flex: 1,
position: 'absolute',
bottom: 0,
left: 0,
right: 0,
top: 0,
justifyContent: 'center',
alignItems: 'center',
},
view: {
flex: 1
},
text: {
fontSize: 20,
color: 'white',
textAlign: 'center',
},
});

AppRegistry.registerComponent('App', () => App);
```

## References

Demo app is inspired by [UIVisualEffects](https://github.com/ide/UIVisualEffects) repo.

---

**MIT Licensed**