Browse documentation

Reference / Transitions & animation

Zoom and pop animations

Use zoom to combine opacity and scale. Pop adds a small overshoot before settling at full size.

Working example

The origin-left class in the sample anchors the reveal beside the disclosure edge. Use origin-center for a centered dialog.

HTML
<details class="group rounded border p-4">
  <summary class="cursor-pointer font-semibold">Unpack the proof</summary>
  <p class="mt-3 origin-left motion-safe:group-open:animate-pop">Revision B is ready.</p>
</details>

Class reference

ClassCSS declarations
animate-zoom-inanimation: mono-zoom-in 300ms ease-out both;
animate-zoom-outanimation: mono-zoom-out 300ms ease-in both;
animate-popanimation: mono-pop 320ms ease-out both;
View full generated CSS
Compiled CSS
@keyframes mono-pop {
  0% {
    transform: scale(.8);
    opacity: 0;
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes mono-zoom-in {
  from {
    opacity: 0;
    transform: scale(.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes mono-zoom-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(.85);
  }
}
.animate-pop {
  animation: mono-pop 320ms ease-out both;
}
.animate-zoom-in {
  animation: mono-zoom-in 300ms ease-out both;
}
.animate-zoom-out {
  animation: mono-zoom-out 300ms ease-in both;
}