Capítulo 65 de 142

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

  1. delay supports Delay a callback.
  2. delay supports Cancel.
  3. delay supports Animation loop.

Connects To

  • frame: related Motion doc page.
  • animate(): related Motion doc page.
  • stagger: related Motion doc page.