Last active
February 6, 2022 08:13
-
-
Save louicoder/21215f8a6da9f79b7be9c182041b014e to your computer and use it in GitHub Desktop.
React native box show Shadow properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Properties need to obtain a box shadow effect in React native | |
const shadow = { | |
elevation: 4, | |
shadowOffset: { width: 3, height: 5 }, | |
shadowColor: '#ccc', | |
shadowOpacity: 0.2, | |
shadowRadius: 10 | |
}; | |
const shadow2 = { | |
shadowColor: '#171717', | |
shadowOffset: { width: -2, height: 4 }, | |
shadowOpacity: 0.2, | |
shadowRadius: 3 | |
}; | |
// This is more preferable | |
const shadow3 = { | |
shadowColor: '#00000090', | |
shadowOffset: { width: 0, height: RFValue(3) }, | |
shadowRadius: 8, | |
shadowOpacity: 0.2 | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment