interface Repeat {
    repeat?: number;
    repeatDelay?: number;
    repeatType?: "reverse" | "loop" | "mirror";
}

Hierarchy (view full)

Properties

repeat?: number

The number of times to repeat the transition. Set to Infinity for perpetual repeating.

Without setting repeatType, this will loop the animation.

<motion.div
animate={{ rotate: 180 }}
transition={{ repeat: Infinity, duration: 2 }}
/>
repeatDelay?: number

When repeating an animation, repeatDelay will set the duration of the time to wait, in seconds, between each repetition.

<motion.div
animate={{ rotate: 180 }}
transition={{ repeat: Infinity, repeatDelay: 1 }}
/>
repeatType?: "reverse" | "loop" | "mirror"

How to repeat the animation. This can be either:

"loop": Repeats the animation from the start

"reverse": Alternates between forward and backwards playback

"mirror": Switches from and to alternately

<motion.div
animate={{ rotate: 180 }}
transition={{
repeat: 1,
repeatType: "reverse",
duration: 2
}}
/>

Generated using TypeDoc