Back to library
INTERACTION_062

Letter Explosion And Assembly.

Characters burst outward then reassemble into the word. Assembled in place before the trigger; scattering characters outward with rotation, then returning them to their positions once hover on desktop, or once on entry.

CATEGORY
Letters
COMPLEXITY
Advanced
TECH
CSS + JS
PLATFORM
Both
PERFORMANCE
Medium
LIVE PLAYGROUND
VAULT
CSS / CSS
/* Letter Explosion And Assembly — Characters burst outward then reassemble into the word. */
.letter-explosion-assembly {
  --dur: 1.1s;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --stagger: 25ms;
  will-change: transform, opacity;
}

.letter-explosion-assembly > * {
  opacity: 0;
  transform: translateY(14px);
  animation: letter-explosion-assembly-in var(--dur) var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}

/* assembled in place -> scattering characters outward with rotation, then returning them to their positions */
@keyframes letter-explosion-assembly-in {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .letter-explosion-assembly > * {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
React / TSX
import { useEffect, useRef } from "react";

/** Letter Explosion And Assembly — trigger: hover on desktop, or once on entry */
export function LetterExplosionAndAssembly({ children }: { children: React.ReactNode }) {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current;
    if (!el) return;
    if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
      el.dataset["state"] = "in";
      return;
    }
    const io = new IntersectionObserver(
      ([entry]) => {
        if (entry?.isIntersecting) {
          el.dataset["state"] = "in";
          io.unobserve(el);
        }
      },
      { threshold: 0.2 },
    );
    io.observe(el);
    return () => io.disconnect();
  }, []);

  return (
    <div ref={ref} className="letter-explosion-assembly" data-state="out">
      {children}
    </div>
  );
}

IF YOU LIKE THIS, STEAL THESE TOO.

VAULT
INTERACTION_056CSS

Liquid Letter Distortion

Characters skew and wobble like type on a moving surface.

Letters / MediumView
VAULT
INTERACTION_047CSS

Letter By Letter Fade

Characters fade in one by one to draw the eye across the word.

Letters / LightView
VAULT
INTERACTION_051CSS

Letter Flip

Characters flip on the X axis like a departure board.

Letters / LightView
VAULT
INTERACTION_052CSS

Letter Blur

Characters sharpen from a heavy blur into crisp type.

Letters / MediumView