File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,40 @@ Example:
65
65
66
66
See all examples [ here] ( https://dielduarte.github.io/animate-css-styled-components/ )
67
67
68
+ ## How to create custom styled animations
69
+
70
+ You can import BaseAnimation component and create your custom animation
71
+
72
+ Example:
73
+
74
+ ```
75
+ import { BaseAnimation } from 'animate-css-styled-components';
76
+
77
+ //create your custom animation
78
+ const SlideOutDownAnimation = keyframes`
79
+ from {
80
+ transform: translate3d(0, 0, 0);
81
+ }
82
+
83
+ to {
84
+ visibility: hidden;
85
+ transform: translate3d(0, 100%, 0);
86
+ }
87
+ `;
88
+
89
+ //extend BaseAnimation component and create
90
+ //your custom styled animation
91
+ const SlideOutDown = styled(BaseAnimation)`
92
+ animation-name: ${SlideOutDownAnimation};
93
+ `;
94
+
95
+ //export your custom styled animation
96
+ export default SlideOutDown;
97
+ ```
98
+
99
+ now your animation is a styled-component and you can use this like any other styled-component,
100
+ passing the all BaseAnimation [ props] ( https://github.com/dielduarte/animate-css-styled-components#props ) .
101
+
68
102
# WIP
69
103
- tests with jest
70
104
- ` animate ` component, wrapper for all animations with a only component.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " animate-css-styled-components" ,
3
- "version" : " 0.0.13 " ,
3
+ "version" : " 0.0.14 " ,
4
4
"description" : " port of animate.css for styled-components" ,
5
5
"main" : " ./lib/index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change
1
+ import BaseAnimation from './BaseAnimation' ;
1
2
import Flash from './Attention/Flash' ;
2
3
import HeadShake from './Attention/HeadShake' ;
3
4
import Jello from './Attention/Jello' ;
@@ -164,5 +165,6 @@ export {
164
165
ZoomOutDown ,
165
166
ZoomOutLeft ,
166
167
ZoomOutRight ,
167
- ZoomOutUp
168
+ ZoomOutUp ,
169
+ BaseAnimation
168
170
} ;
You can’t perform that action at this time.
0 commit comments