Categories
JavaScript Answers React Native Answers

How to add the blur effect with React Native?

Spread the love

Sometimes, we want to add the blur effect with React Native.

In this article, we’ll look at how to add the blur effect with React Native.

How to add the blur effect with React Native?

To add the blur effect with React Native, we can set the blurRadius of the Image.

For instance, we write:

import * as React from 'react';
import { View, Image } from 'react-native';
import Constants from 'expo-constants';
import { Card } from 'react-native-paper';

export default function App() {
  return (
    <View>
      <Image
        resizeMode="cover"
        source="https://picsum.photos/200/300"
        blurRadius={6}
        style={{ width: 200, height: 300 }}
      />
    </View>
  );
}

to add the Image component to add an image.

Then we set the blurRadius prop to a positive number to add the blur effect.

Conclusion

To add the blur effect with React Native, we can set the blurRadius of the Image.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *