You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -87,4 +87,36 @@ const MyComponent = () => (
87
87
88
88
## API
89
89
### `spring(start, target, options)`
90
+
91
+
This method creates spring-based keyframes. Called with start and target properties, it returns an object with the interpolated animation values.
92
+
93
+
#### Arguments
94
+
95
+
-`start` (_Object_): The start properties for the animation. The keys should be css properties, the values should be able to be parsed to a number by `parseFloat`. Keys that can not be parsed or do not exist in the target properties are ignored.
96
+
-`target` (_Object_): The target properties for the animation. The keys should be css properties, the values should be able to be parsed to a number by `parseFloat`. Keys that can not be parsed or do not exist in the start properties are ignored.
97
+
-`options` (_Object_, optional): Animation options with these properties:
98
+
-`precision` (_Number_, optional, defaults to `3`) Specifies the number of decimals in the rounding of interpolated values.
99
+
-`preset` (_String_, optional): Presets for `stiffness` and `damping`, overriding any stiffness and damping values given. Available presets:
100
+
-`stiff` stiffness 210, damping 20
101
+
-`gentle` stiffness 120, damping 14
102
+
-`wobbly` stiffness 180, damping 12
103
+
-`noWobble` stiffness 170, damping 26
104
+
-`stiffness` (_Number_, optional, default: 170): The stiffness of your spring-based animation.
105
+
-`damping` (_Number_, optional, default: 26): The damping of your spring-based animation.
106
+
107
+
#### Returns
108
+
109
+
An object with `0%` to `100%` keys and the interpolated physics-based values for each step of the animation, e.g.:
0 commit comments