Looping animation

Also called infinite animation or animation-iteration-count

An animation that plays more than once, either a set number of times or forever, set in CSS with animation-iteration-count.

What is Looping animation?

A looping animation repeats instead of stopping after one run. In CSS, animation-iteration-count sets how many times it plays: 1 by default, a number such as 3, or infinite. Motion for React uses a repeat option that counts the extra runs, so repeat: 2 plays three times in total and repeat: Infinity never stops.

Endless loops fit things that stand for ongoing work: spinners, skeleton shimmers, a pulsing live indicator. A small fixed count suits attention cues, such as a bell that rings three times when a message arrives and then rests.

Endless motion pulls the eye and can make some people feel unwell. Stop a loop once its job is done, pause it while it is off screen, and stop or slow it for people who prefer reduced motion. Accessibility guidelines (WCAG) ask for a way to pause motion that starts on its own and lasts more than five seconds.

Often confused with

Yoyo animation
A yoyo animation is a loop that reverses direction on every other run. A plain loop restarts from the beginning each time.
All terms

Yoyo animation

A looping animation that plays forward and then backward, so it moves back and forth smoothly instead of jumping back to the start.

Spinner

A small looping animation, usually a rotating ring, that shows the app is busy with a short task of unknown length.

Pulse animation

A soft, repeating beat or expanding ring that draws the eye to a live status, a new notification, or something that needs attention.

Reduced motion

An operating system setting that asks apps to minimize movement, which websites detect with the prefers-reduced-motion media query.