@@ -20,14 +20,12 @@ Add `spin` style object to an `Animated` component add a linear spinning animati
20
20
21
21
<img src =" https://github.com/user-attachments/assets/d3a87650-83f4-476b-bf85-832a3a2d0fea " alt =" Spin animation demo " align =" right " width =" 275 " />
22
22
23
- ``` typescript
23
+ ``` jsx
24
24
import { spin } from ' react-native-css-animations' ;
25
25
import Animated from ' react-native-reanimated' ;
26
26
27
27
function App () {
28
- return (
29
- < Animated .View style = {[styles .spinner , spin ]}/>
30
- )
28
+ return < Animated .View style= {[styles .spinner , spin]} / > ;
31
29
}
32
30
```
33
31
@@ -37,14 +35,12 @@ Add `ping` style object to an `Animated` component to make the element scale and
37
35
38
36
<img src =" https://github.com/user-attachments/assets/51c604b4-621b-4821-ab9a-f289f15e07ae " alt =" Ping animation demo " align =" right " width =" 275 " />
39
37
40
- ` ` ` typescript
38
+ ``` jsx
41
39
import { ping } from ' react-native-css-animations' ;
42
40
import Animated from ' react-native-reanimated' ;
43
41
44
42
function App () {
45
- return (
46
- <Animated.View style={[styles.notification, ping]}/>
47
- )
43
+ return < Animated .View style= {[styles .notification , ping]} / > ;
48
44
}
49
45
```
50
46
@@ -54,14 +50,12 @@ Add `pulse` style object to an `Animated` component to make it fade in and out.
54
50
55
51
<img src =" https://github.com/user-attachments/assets/d36924b1-f4f8-4bd4-b3dd-a298d3b2f4b6 " alt =" Pulse animation demo " align =" right " width =" 275 " />
56
52
57
- ` ` ` typescript
53
+ ``` jsx
58
54
import { pulse } from ' react-native-css-animations' ;
59
55
import Animated from ' react-native-reanimated' ;
60
56
61
57
function App () {
62
- return (
63
- <Animated.View style={[styles.skeleton, pulse]}/>
64
- )
58
+ return < Animated .View style= {[styles .skeleton , pulse]} / > ;
65
59
}
66
60
```
67
61
@@ -71,14 +65,28 @@ Add `bounce` style object to an `Animated` component to make it bounce up and do
71
65
72
66
<img src =" https://github.com/user-attachments/assets/81e75ed0-b7ec-4f56-a06a-c593a626cb39 " alt =" Bounce animation demo " align =" right " width =" 275 " />
73
67
74
- ` ` ` typescript
68
+ ``` jsx
75
69
import { bounce } from ' react-native-css-animations' ;
76
70
import Animated from ' react-native-reanimated' ;
77
71
72
+ function App () {
73
+ return < Animated .View style= {[styles .arrow , bounce]} / > ;
74
+ }
75
+ ```
76
+
77
+ ## Alternative API
78
+
79
+ The following animations are also available in a form of React Native components.
80
+
81
+ ``` jsx
82
+ import { Spin , Ping , Pulse , Bounce } from ' react-native-css-animations' ;
83
+
78
84
function App () {
79
85
return (
80
- <Animated.View style={[styles.arrow, bounce]}/>
81
- )
86
+ < Bounce>
87
+ < ArrowIcon / >
88
+ < / Bounce>
89
+ );
82
90
}
83
91
```
84
92
0 commit comments