React Native Shadow Generator
Turn offset, blur, opacity and colour into React Native shadow styles for iOS and an elevation value for Android, with a preview.
How to make a React Native shadow
Set the shadow
Choose the offset, blur, opacity and colour.
Compare
The preview shows the matching CSS shadow.
Copy the style
Use the iOS lines, the Android line, or both.
iOS and Android draw shadows differently, so check both on a device.
Worked example
This is what React Native Shadow Generator gives for its own sample values. Open the tool above and change anything to try your own.
- Horizontal offset
- 0
- Vertical offset
- 4
- Blur
- 8
- Opacity (0 to 1)
- 0.25
- Shadow colour
- #000000
iOS (style object)
shadowColor: "#000000",
shadowOffset: { width: 0, height: 4 },
shadowOpacity: 0.25,
shadowRadius: 4,Android
elevation: 8,
About React Native Shadow Generator
React Native shadows work differently on each platform. iOS reads shadowColor, shadowOffset, shadowOpacity and shadowRadius. Android reads a single elevation number. This tool converts a familiar shadow into both.
FAQs
Why does Android look different?
Android draws its own shadow from the elevation value and does not use the offset or colour, so the match is only close.
Is there a spread value?
No. React Native has no spread, so a CSS spread cannot be carried over.
Do I need a background colour?
Yes. A shadow only shows on a view with a solid background.