React Native - How to do Blur View like iOS or instagram?

Balasubramanian picture Balasubramanian · May 13, 2018 · Viewed 8.7k times · Source

Background Transparency with BLUR

Is it possible to blur view without using background Image? I want to show the parent content on top of the background blur view in modal.

Similar kind of this:

blur view

Tried with react-native-blur :

Its actually blurring the background image. I want to blur and show the content which is behind the modal.

Tried along with react-native-overlay : But no change.

Answer

Rizwan Atta picture Rizwan Atta · Dec 26, 2018

well if you are

using expo

then you should go and check out this link here

else if you are like me

who loves to use 'react-native init' and want some blurry effect based views then i have this for you!

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

an awesome library

it would be very simple to use it like

"if the dialogbox is open then render The blur view else render simple",

here is a simple example for basic how to use!

...imports
var EffectsView = require('react-native-effects-view');

var App = React.createClass({
renderVibrant() {
    return (
        <View>
            <Text style={styles.text}>Do you feel blurry??</Text>
        </View>
    );
},

render() {
    return (
        <EffectsView 
            style={styles.view} 
            blurStyle="dark" 
            vibrantContent={this.renderVibrant()}
        >
            <Image style={styles.bg} source={require('image!bg')} />
        </EffectsView>
    );
}
});