Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 203
Balasubramanian Avatar asked May 13 '18 14:05

Balasubramanian


1 Answers

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>
    );
}
});
like image 54
M.Rizwan Avatar answered Oct 19 '22 17:10

M.Rizwan