1. Transitions & Animation
  2. animation

Transitions & Animation

animation

Classes for adding motion to elements using CSS animations.

ClassStyles
animate-spin
animation: var(--animate-spin); /* spin 1s linear infinite */ @keyframes spin { to { transform: rotate(360deg); } }
animate-ping
animation: var(--animate-ping); /* ping 1s cubic-bezier(0, 0, 0.2, 1) infinite */ @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
animate-pulse
animation: var(--animate-pulse); /* pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite */ @keyframes pulse { 50% { opacity: 0.5; } }
animate-bounce
animation: var(--animate-bounce); /* bounce 1s infinite */ @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, 0.2, 1); } }
animate-none
animation: none;
animate-(<custom-property>)
animation: var(<custom-property>);
animate-[<value>]
animation: <value>;

Examples

Applying a spin animation

Reach for the animate-spin utility to give elements like loading indicators a smooth, continuous spin:

<button type="button" class="bg-indigo-500 ..." disabled>  <svg class="mr-3 size-5 animate-spin ..." viewBox="0 0 24 24">    <!-- ... -->  </svg>  Processing…</button>

Applying a ping animation

Reach for the animate-ping utility to make an element expand and fade outward like sonar or a ripple on water—perfect for things like notification badges:

<span class="relative flex size-3">  <span class="absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-400 opacity-75"></span>  <span class="relative inline-flex size-3 rounded-full bg-sky-500"></span></span>

Applying a pulse animation

Reach for the animate-pulse utility to make an element softly fade in and out—ideal for things like skeleton loaders:

<div class="mx-auto w-full max-w-sm rounded-md border border-blue-300 p-4">  <div class="flex animate-pulse space-x-4">    <div class="size-10 rounded-full bg-gray-200"></div>    <div class="flex-1 space-y-6 py-1">      <div class="h-2 rounded bg-gray-200"></div>      <div class="space-y-3">        <div class="grid grid-cols-3 gap-4">          <div class="col-span-2 h-2 rounded bg-gray-200"></div>          <div class="col-span-1 h-2 rounded bg-gray-200"></div>        </div>        <div class="h-2 rounded bg-gray-200"></div>      </div>    </div>  </div></div>

Applying a bounce animation

Reach for the animate-bounce utility to make an element hop up and down—great for things like "scroll down" indicators:

<svg class="size-6 animate-bounce ...">  <!-- ... --></svg>

Respecting reduced motion

When a visitor has indicated that they prefer reduced motion, you can conditionally apply animations and transitions using the motion-safe and motion-reduce variants:

<button type="button" class="bg-indigo-600 ..." disabled>  <svg class="mr-3 size-5 motion-safe:animate-spin ..." viewBox="0 0 24 24">    <!-- ... -->  </svg>  Processing</button>

Setting a custom value

Reach for the animate-[<value>] syntax to drive the animation from a fully custom value:

<div class="animate-[wiggle_1s_ease-in-out_infinite] ...">  <!-- ... --></div>

For CSS variables, you can also reach for the animate-(<custom-property>) syntax:

<div class="animate-(--my-animation) ...">  <!-- ... --></div>

It's simply a shorthand for animate-[var(<custom-property>)] that adds the var() function on your behalf.

Responsive usage

Add a breakpoint variant such as md: in front of an animation utility to apply it only at medium screen sizes and up:

<div class="animate-none md:animate-spin ...">  <!-- ... --></div>

Read more about using variants in the variants documentation.

Tailoring your theme

Reach for the --animate-* theme variables to tailor the animation utilities across your project:

@theme {  --animate-wiggle: wiggle 1s ease-in-out infinite;  @keyframes wiggle {    0%,    100% {      transform: rotate(-3deg);    }    50% {      transform: rotate(3deg);    }  }}

The animate - wiggle utility is now ready to use in your markup:

<div class="animate-wiggle">  <!-- ... --></div>

Read more about tailoring your theme in the theme documentation.

Ship interfaces people love — 5-day mini-course

5-day mini-course

Ship UIs you'll be proud of.

Short, hands-on video lessons from the team behind Breezel, delivered straight to your inbox every single day for a week.

Claim the free course

Copyright © 2026 Breezel, Inc.·Trademark Policy