Chapter 65: delay
Core Idea
Discover Motion's delay function, a setTimeout alternative locked to the animation frame loop. Learn how it helps synchronize callbacks with animations, and reduces computational overhead.
Key Concepts
- Delay a callback: Pass a callback and duration (measured in seconds) to delay.
- Cancel: delay returns a function that
- Animation loop: delay fires its callback on the first step of Motion's animation loop
- Animate faster with Motion+.: Unlock 430+ premium examples
Code Examples
import { delay } from "motion"
- What it demonstrates: Core usage pattern for delay.
Key Takeaways
- delay supports Delay a callback.
- delay supports Cancel.
- delay supports Animation loop.
Connects To
- frame: related Motion doc page.
- animate(): related Motion doc page.
- stagger: related Motion doc page.