File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
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.
You can’t perform that action at this time.
0 commit comments