Back to library
INTERACTION_063

Split Line Hero Reveal.

The hero headline arrives line by line from behind its own masks. Each line translated 110% below its mask at 0 opacity before the trigger; translating each line to 0 while fading in once the hero mounts, after fonts are ready.

CATEGORY
Headlines
COMPLEXITY
Easy
TECH
CSS
PLATFORM
Both
PERFORMANCE
Light
LIVE PLAYGROUND
SPLIT LINE
HERO REVEAL.
CSS / CSS
/* Split Line Hero Reveal — The hero headline arrives line by line from behind its own masks. */
.split-line-hero-reveal {
  --dur: 850ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --stagger: 95ms;
  will-change: transform, opacity;
}

.split-line-hero-reveal > * {
  opacity: 0;
  transform: translateY(14px);
  animation: split-line-hero-reveal-in var(--dur) var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}

/* each line translated 110% below its mask at 0 opacity -> translating each line to 0 while fading in */
@keyframes split-line-hero-reveal-in {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

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

/** Split Line Hero Reveal — trigger: the hero mounts, after fonts are ready */
export function SplitLineHeroReveal({ 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="split-line-hero-reveal" data-state="out">
      {children}
    </div>
  );
}

IF YOU LIKE THIS, STEAL THESE TOO.

MAKE IT
FEEL PREMIUM.
INTERACTION_032CSS

Masked Line Reveal

Each line slides up from behind an invisible mask, one after the other.

Text / LightView
INTERACTION_003CSS + JS

Magnetic Button

Subtle cursor-following CTA interaction.

Buttons / LightView
HEADLINE
INTERACTION_066CSS

Animated Headline Underline

A precise 2px rule draws itself under the headline.

Headlines / LightView
BUILT FOR
FOUNDERSDESIGNERS
INTERACTION_067CSS

Changing Emphasis Word

The emphasised word cycles through audiences or outcomes.

Headlines / LightView