Swish UI
All componentsCards and layout Free

Infinite marquee

A row of host wordmarks scrolls forever behind soft edge fades and stops while you point at it.

It imports two small hooks from @/lib/motion and the colour tokens; the zip includes both.

Demo.tsx

"use client";
import { useRef } from "react";
import { useInView } from "@/lib/motion";
import styles from "./demo.module.css";

const BRANDS = [
  { name: "Casa Mar", style: "serif" },
  { name: "VILLA AZUL", style: "caps" },
  { name: "olive house", style: "lower" },
  { name: "Palm Court", style: "serif" },
  { name: "DRIFTWOOD", style: "caps" },
  { name: "lagoon stays", style: "lower" },
  { name: "Northbay", style: "bold" },
  { name: "Cedar & Co", style: "serif" },
] as const;

export default function Demo() {
  const root = useRef<HTMLDivElement>(null);
  const inView = useInView(root);

  // Two identical groups: the track moves by exactly one group width, then starts over.
  const group = (copy: boolean) => (
    <ul className={styles.group} aria-hidden={copy || undefined}>
      {BRANDS.map((b) => (
        <li key={b.name}>
          <a href="#" className={`${styles.brand} ${styles[b.style]}`} tabIndex={copy ? -1 : undefined} onClick={(e) => e.preventDefault()}>
            {b.name}
          </a>
        </li>
      ))}
    </ul>
  );

  return (
    <div ref={root} className={`${styles.root} ${inView ? "" : styles.paused}`}>
      <p className={styles.caption}>Hosts who sell their gap nights with us</p>
      <div className={styles.viewport}>
        <div className={styles.track}>
          {group(false)}
          {group(true)}
        </div>
      </div>
    </div>
  );
}

demo.module.css

.root { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 22px; overflow: hidden; }
.caption { padding: 0 16px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; }
.viewport { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, var(--ink) 15%, var(--ink) 85%, transparent); mask-image: linear-gradient(90deg, transparent, var(--ink) 15%, var(--ink) 85%, transparent); }
.track { display: flex; width: max-content; animation: scroll 28s linear infinite; }
.viewport:hover .track, .viewport:focus-within .track, .paused .track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }

.group { display: flex; align-items: center; gap: 48px; margin: 0; padding: 0 48px 0 0; list-style: none; }
.brand { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; white-space: nowrap; opacity: .55; transition: opacity .2s, color .2s; }
.brand:hover, .brand:focus-visible { opacity: 1; color: var(--accent-text); }
.serif { font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-style: italic; letter-spacing: -0.01em; }
.caps { font-size: 16px; font-weight: 700; letter-spacing: .22em; }
.lower { font-size: 22px; font-weight: 500; letter-spacing: -0.04em; }
.bold { font-size: 23px; font-weight: 800; letter-spacing: -0.05em; }

@media (prefers-reduced-motion: reduce) {
  .track { animation: none; width: auto; justify-content: center; }
  .group { flex-wrap: wrap; justify-content: center; gap: 4px 28px; padding: 0 16px; }
  .group[aria-hidden] { display: none; }
  .viewport { -webkit-mask-image: none; mask-image: none; }
}

Use it for

  • Social proof rows of partner or customer names
  • Tickers of short, equal weight items

Avoid

  • Content people need to read or click in a hurry
  • Pages that already have other constant motion

How it works

The track holds two identical groups and animates translateX from 0 to minus 50 percent, which is exactly one group, so the loop is seamless. Each group ends with padding equal to its gap so the seam spacing matches. A mask-image gradient fades both edges. Hover, focus inside and being off screen all set animation-play-state to paused.

Accessibility

The second group is aria-hidden and its links are out of the tab order, so each name is read once. Focusing a link pauses the row. Reduced motion stops the scroll and wraps the names into a static centred list.

Found on