Animation
Utilities for animating elements with CSS animations.
Class reference
Spin
Add the animate-spin
utility to add a linear spin animation to elements like loading indicators.
Ping
Add the animate-ping
utility to make an element scale and fade like a radar ping or ripple of water — useful for things like notification badges.
Pulse
Add the animate-pulse
utility to make an element gently fade in and out — useful for things like skeleton loaders.
Bounce
Add the animate-bounce
utility to make an element bounce up and down — useful for things like “scroll down” indicators.
Prefers-reduced-motion
You can conditionally apply animations and transitions using the motion-safe
and motion-reduce
variants:
<button type="button" class="bg-teal-600 ..." disabled>
<svg class="motion-safe:animate-spin h-5 w-5 mr-3 ..." viewBox="0 0 24 24">
<!-- ... -->
</svg>
Processing
</button>
Learn more in the state variants documentation.
Responsive
To change or disable an animation at a specific breakpoint, add a {screen}:
prefix to any existing animation utility. For example, use md:animate-none
to apply the animate-none
utility at only medium screen sizes and above.
<div class="animate-spin md:animate-none ...">
<!-- ... -->
</div>
For more information about Elements’ responsive design features, check out the Responsive Design documentation.
On this Page
v1.13.5