Loop Animations
Animations that repeat indefinitely
Basic Usage
Create loop animations by using the loop
direction with any base animation:
Overview
Loop animations are continuous animations that repeat indefinitely. They're perfect for creating ongoing visual effects like spinners, pulsing elements, or floating objects.
Each element will continuously animate between its default state and the target state (the value after -loop-
). For example:
motion-translate-y-loop-25
alternates betweentranslateY(0)
andtranslateY(25%)
motion-scale-loop-110
alternates betweenscale(1)
andscale(1.1)
motion-rotate-loop-45
alternates betweenrotate(0deg)
androtate(45deg)
motion-opacity-loop-50
alternates between100%
and50%
opacity
Loop Modifiers
Loop animations can be modified with /mirror
or /reset
to achieve different looping behaviors:
Mirror Loops
Adding /mirror
creates a back-and-forth animation that reverses direction:
Reset Loops
Adding /reset
makes the animation return instantly to its starting position:
This is particularly useful for creating spinners
Customizing Loop Animations
You can customize loop animations using modifiers. See the applying modifiers guide for more details:
Combining Loop Animations
Stack multiple loop animations to create complex effects:
Presets
Explore our collection of animation presets to quickly apply pre-defined loop animations to your projects.