Back to library
INTERACTION_068

Horizontal Text Marquee.

Oversized type scrolls sideways in a continuous loop. The track parked at translateX(0) before the trigger; translating the track to -50% and looping seamlessly once always while in view, paused off-screen and on hover.

CATEGORY
Headlines
COMPLEXITY
Easy
TECH
CSS
PLATFORM
Both
PERFORMANCE
Light
LIVE PLAYGROUND
PREMIUM MOTION —PREMIUM MOTION —PREMIUM MOTION —PREMIUM MOTION —
CSS / CSS
/* Horizontal Text Marquee — Oversized type scrolls sideways in a continuous loop. */
.horizontal-text-marquee {
  --dur: 22s;
  --ease: linear;
  --stagger: 60ms;
  will-change: transform, opacity;
}

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

/* the track parked at translateX(0) -> translating the track to -50% and looping seamlessly */
@keyframes horizontal-text-marquee-in {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

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

/** Horizontal Text Marquee — trigger: always while in view, paused off-screen and on hover */
export function HorizontalTextMarquee({ 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="horizontal-text-marquee" data-state="out">
      {children}
    </div>
  );
}

IF YOU LIKE THIS, STEAL THESE TOO.

SPLIT LINE
HERO REVEAL.
INTERACTION_063CSS

Split Line Hero Reveal

The hero headline arrives line by line from behind its own masks.

Headlines / 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
BUILT FOR
FOUNDERSDESIGNERS
INTERACTION_069CSS

Text Morphing

One phrase blurs and dissolves directly into the next.

Headlines / MediumView