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
**react-spring** is a spring-physics based animation library that should cover most of your UI related animation needs. It gives you tools flexible enough to confidently cast your ideas into moving interfaces.
7
+
<h1align="center">react-spring</h1>
8
+
<h3align="center">A spring-physics first animation library <br>giving you flexible tools to confidently cast your ideas</h3>
10
9
11
-
This library represents a modern approach to animation. It is very much inspired by Christopher Chedeau's [animated](https://github.com/animatedjs/animated) and Cheng Lou's [react-motion](https://github.com/chenglou/react-motion). It inherits animated's powerful interpolations and performance, as well as react-motion's ease of use. But while animated is mostly imperative and react-motion mostly declarative, react-spring bridges both. You will be surprised how easy static data is cast into motion with small, explicit utility functions that don't necessarily affect how you form your views.
10
+
<br>
12
11
13
-
[](https://github.com/pmndrs/react-spring/actions/workflows/main.yml)[](https://badge.fury.io/js/react-spring)[](https://discord.gg/ZZjjNvJ)[](#backers)[](#sponsors)
<img src="https://img.shields.io/discord/740090768164651008?style=flat&colorA=000000&colorB=000000&label=discord&logo=discord&logoColor=ffffff" alt="Chat on Discord">
21
+
</a>
22
+
</p>
14
23
15
-
### Installation
24
+
<br>
16
25
17
-
npm install react-spring
26
+
`react-spring` is a cross-platform spring-physics first animation library.
18
27
19
-
### Documentation and Examples
28
+
It's as simple as:
20
29
21
-
More info about the project can be found [here](https://www.react-spring.io).
30
+
```jsx
31
+
conststyles=useSpring({
32
+
from: {
33
+
opacity:0
34
+
},
35
+
to: {
36
+
opacity:1
37
+
}
38
+
})
22
39
23
-
Examples and tutorials can be found [here](https://react-spring.io/basics).
40
+
<animated.div style={styles} />
41
+
```
24
42
25
-
---
43
+
Just a small bit about us:
26
44
27
-
## Why springs and not durations
45
+
-**Cross-Platform**: We support `react-dom`, `react-native`, `react-three-fiber`, `react-konva` & `react-zdog`.
46
+
-**Versatile**: Be declarative with your animations or if you prefer, imperative.
47
+
-**Spring-Physics First**: By default animation use springs for fluid interactivity, but we support durations with easings as well.
28
48
29
-
The principle you will be working with is called a `spring`, it _does not have a defined curve or a set duration_. In that it differs greatly from the animation you are probably used to. We think of animation in terms of time and curves, but that in itself causes most of the struggle we face when trying to make elements on the screen move naturally, because nothing in the real world moves like that.
49
+
There's a lot more to be had! Give it a try and find out.
It's as simple as that to create scroll-in animations when value of `isVisible` is toggled.
76
+
77
+
### 📖 Documentation and Examples
34
78
35
-
We are so used to time-based animation that we believe that struggle is normal, dealing with arbitrary curves, easings, time waterfalls, not to mention getting this all in sync. As Andy Matuschak (ex Apple UI-Kit developer) [expressed it once](https://twitter.com/andy_matuschak/status/566736015188963328): _Animation APIs parameterized by duration and curve are fundamentally opposed to continuous, fluid interactivity_.
79
+
More documentation on the project can be found [here](https://www.react-spring.io).
36
80
37
-
Springs change that, animation becomes easy and approachable, everything you do looks and feels natural by default. For a detailed explanation watch [this video](https://www.youtube.com/embed/1tavDv5hXpo?controls=1&start=370).
81
+
Pages contain their own [examples](https://react-spring.io/hooks/use-spring#demos) which you can check out there, or [open in codesandbox](https://codesandbox.io/s/github/pmndrs/react-spring/tree/master/demo/src/sandboxes/card) for a more in-depth view!
@@ -52,40 +98,15 @@ Springs change that, animation becomes easy and approachable, everything you do
52
98
53
99
And [many others...](https://github.com/pmndrs/react-spring/network/dependents)
54
100
55
-
## Funding
56
-
57
-
If you like this project, please consider helping out. All contributions are welcome as well as donations to [Opencollective](https://opencollective.com/react-spring), or in crypto:
58
-
59
-
BTC: 36fuguTPxGCNnYZSRdgdh6Ea94brCAjMbH
60
-
61
-
ETH: 0x6E3f79Ea1d0dcedeb33D3fC6c34d2B1f156F2682
62
-
63
-
You can also support this project by becoming a sponsor. Your logo will show up here with a link to your website.
Thank you to all our backers! 🙏 If you want to join them here, then consider contributing to our [Opencollective](https://opencollective.com/react-spring).
0 commit comments