@@ -8,24 +8,126 @@ React Native library with Android native view which supports same shadows styles
88npm install @dimaportenko/react-native-shadow-view
99```
1010
11+ ## Example
12+ <table >
13+ <tr>
14+ <th style='padding-right: 30px'>
15+ <h1>iOS</h1>
16+ <img src="./docs/ios.png" height='600' />
17+ </th>
18+ <th>
19+ <h1>Android</h1>
20+ <img src="./docs/android.jpeg" height='600' />
21+ </th>
22+ </tr>
23+ </table >
24+
1125## Usage
1226
1327``` js
14- import { ShadowView } from ' @dimaportenko/ react-native-shadow-view ' ;
28+ import * as React from ' react' ;
1529
16- // ...
30+ import { StyleSheet , View } from ' react-native' ;
31+ import { ShadowView } from ' @dimaportenko/react-native-shadow-view' ;
1732
18- < ShadowView style= {[styles .box , styles .shadow ]} / >
33+ export default function App () {
34+ return (
35+ < View style= {styles .container }>
36+ < View style= {styles .row }>
37+ < ShadowView style= {[styles .box1 , styles .shadow1 ]}>
38+ < View style= {styles .inner } / >
39+ < / ShadowView>
40+ < ShadowView style= {[styles .box2 , styles .shadow2 ]} / >
41+ < / View>
42+ < View style= {styles .row }>
43+ < ShadowView style= {[styles .box3 , styles .shadow3 ]} / >
44+ < ShadowView style= {[styles .box4 , styles .shadow4 ]} / >
45+ < / View>
46+ < View style= {styles .row }>
47+ < ShadowView style= {[styles .box5 , styles .shadow5 ]} / >
48+ < ShadowView style= {[styles .box6 , styles .shadow6 ]} / >
49+ < / View>
50+ < / View>
51+ );
52+ }
1953
20- // ...
2154const styles = StyleSheet .create ({
22- box: {
23- width: 60 ,
24- height: 60 ,
25- marginVertical: 20 ,
55+ container: {
56+ flex: 1 ,
57+ alignItems: ' center' ,
58+ justifyContent: ' center' ,
59+ },
60+ box1: {
61+ width: 100 ,
62+ height: 100 ,
63+ margin: 40 ,
64+ backgroundColor: ' white' ,
65+ borderRadius: 15 ,
66+ },
67+ inner: {
68+ width: 100 ,
69+ height: 100 ,
70+ borderRadius: 15 ,
71+ },
72+ box2: {
73+ width: 100 ,
74+ height: 100 ,
75+ margin: 40 ,
76+ backgroundColor: ' gray' ,
77+ },
78+ box3: {
79+ width: 100 ,
80+ height: 100 ,
81+ margin: 40 ,
82+ backgroundColor: ' yellow' ,
83+ },
84+ box4: {
85+ width: 100 ,
86+ height: 100 ,
87+ margin: 40 ,
2688 backgroundColor: ' green' ,
2789 },
28- shadow: {
90+ box5: {
91+ width: 100 ,
92+ height: 100 ,
93+ margin: 40 ,
94+ backgroundColor: ' pink' ,
95+ },
96+ box6: {
97+ width: 100 ,
98+ height: 100 ,
99+ margin: 40 ,
100+ backgroundColor: ' blue' ,
101+ borderRadius: 4 ,
102+ },
103+ shadow1: {
104+ shadowColor: ' blue' ,
105+ shadowOffset: {
106+ width: 2 ,
107+ height: 4 ,
108+ },
109+ shadowOpacity: 0.6 ,
110+ shadowRadius: 4.65 ,
111+ },
112+ shadow2: {
113+ shadowColor: ' #0F0' ,
114+ shadowOffset: {
115+ width: 2 ,
116+ height: 4 ,
117+ },
118+ shadowOpacity: 0.6 ,
119+ shadowRadius: 4.65 ,
120+ },
121+ shadow3: {
122+ shadowColor: ' #000' ,
123+ shadowOffset: {
124+ width: - 2 ,
125+ height: - 4 ,
126+ },
127+ shadowOpacity: 0.7 ,
128+ shadowRadius: 5.65 ,
129+ },
130+ shadow4: {
29131 shadowColor: ' #000' ,
30132 shadowOffset: {
31133 width: 2 ,
@@ -34,7 +136,29 @@ const styles = StyleSheet.create({
34136 shadowOpacity: 0.6 ,
35137 shadowRadius: 4.65 ,
36138 },
139+ shadow5: {
140+ shadowColor: ' pink' ,
141+ shadowOffset: {
142+ width: - 4 ,
143+ height: 4 ,
144+ },
145+ shadowOpacity: 1 ,
146+ shadowRadius: 4.65 ,
147+ },
148+ shadow6: {
149+ shadowColor: ' #000' ,
150+ shadowOffset: {
151+ width: 2 ,
152+ height: 4 ,
153+ },
154+ shadowOpacity: 0.6 ,
155+ shadowRadius: 4.65 ,
156+ },
157+ row: {
158+ flexDirection: ' row' ,
159+ },
37160});
161+
38162```
39163
40164## Contributing
0 commit comments