How to add shadow to view in react native

In this article, we will be going to learn about how to add shadow to view in react native, while designing UI in react-native some time we have to shadow to view, to do this one way to use react-native cards and another way is to add shadow using stylesheet so in this article we will be going to learn about how to add shadow to view in react native using stylesheet, to do this you don’t need any import just put shadowColor, shadowOffset, shadowOpacity, shadowRadius with elevation

In the above image the left shadow container is with elevation: 3, Right side container is without elevation, let’s look at following example

1. Create a project

After creating project add the following style in your stylesheet

2. Dashboard.js

You can see the header in the above image this header is custom to know more about custom react-native header check this post  

3. Output:

 

Thank you… enjoy coding… 🙂

2 Replies to “How to add shadow to view in react native”

Leave a Reply

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