Chapter 35: React transitions
Core Idea
Control timing with duration/easing, springs, delay and stagger.
Key Concepts
- Setting a transition: transition can be set on any animation prop
- Value-specific transitions: When animating multiple values
- Default transitions: It's possible to set default transitions via the transition prop.
- Inheritance: By default
- Transition settings: Default: Dynamic
- type: Default: Dynamic
- Spring visualiser: Default: 0.3 (or 0.8 if multiple keyframes are defined)
- Tween: Default: 0.3 (or 0.8 if multiple keyframes are defined)
- duration: Default: 0.3 (or 0.8 if multiple keyframes are defined)
Code Examples
const transition = {
duration: 0.8,
delay: 0.5,
ease: [0, 0.71, 0.2, 1.01],
}
- What it demonstrates: Core usage pattern for React transitions.
Key Takeaways
- React transitions supports Setting a transition.
- React transitions supports Value-specific transitions.
- React transitions supports Default transitions.
Connects To
- MotionConfig: related Motion doc page.
- Tween: related Motion doc page.
- CSS spring animations for React, Astro and Vue: related Motion doc page.
- Easing functions: related Motion doc page.
- Install the Motion AI Kit: related Motion doc page.