Logo marquee

A customer logo strip that scrolls endlessly: eight fictional wordmarks drawn as inline SVG and type (swap in your own), a short heading, soft edge fades, pause on hover, and a static centred wrap when the visitor prefers reduced motion. The duplicate row is hidden from screen readers, so each name is announced once.

MarketingBlockTailwind v4

Source

import type { CSSProperties, ReactNode } from "react";
import { cn } from "@/lib/utils";

export type Logo = { name: string; mark: ReactNode };

export type LogoMarqueeProps = {
  title?: string;
  logos?: Logo[];
  /** Seconds for one full loop. */
  duration?: number;
  className?: string;
};

const glyph = "size-7 shrink-0";

/* Fictional wordmarks drawn inline, so the block ships without image files. Replace them with your customers' SVGs. */
export const DEFAULT_LOGOS: Logo[] = [
  {
    name: "Northvane",
    mark: (
      <span className="flex items-center gap-2 text-xl font-semibold tracking-tight">
        <svg viewBox="0 0 24 24" className={glyph} fill="currentColor" aria-hidden="true">
          <path d="M12 2.5 15 12h-6l3-9.5Z" />
          <path d="M12 21.5 9 12h6l-3 9.5Z" opacity=".35" />
        </svg>
        Northvane
      </span>
    ),
  },
  {
    name: "Mossgate",
    mark: (
      <span className="flex items-center gap-2 text-xl font-medium lowercase tracking-tight">
        <svg viewBox="0 0 24 24" className={glyph} fill="none" stroke="currentColor" strokeWidth="2.4" aria-hidden="true">
          <path d="M5 21V11a7 7 0 0 1 14 0v10M9.5 21v-7.5a2.5 2.5 0 0 1 5 0V21" />
        </svg>
        mossgate
      </span>
    ),
  },
  {
    name: "Copperline",
    mark: (
      <span className="flex items-center gap-2.5 text-base font-bold uppercase tracking-[0.18em]">
        <svg viewBox="0 0 24 24" className={glyph} fill="currentColor" aria-hidden="true">
          <path d="M4 20 10 4h3L7 20H4Zm6 0 6-16h3l-6 16h-3Z" />
        </svg>
        Copperline
      </span>
    ),
  },
  {
    name: "Plover",
    mark: (
      <span className="flex items-center gap-2 font-serif text-2xl italic">
        <svg viewBox="0 0 24 24" className={glyph} fill="currentColor" aria-hidden="true">
          <path d="M12 3a9 9 0 1 0 9 9h-9V3Z" />
        </svg>
        Plover
      </span>
    ),
  },
  {
    name: "Orchard Row",
    mark: (
      <span className="flex items-center gap-2 font-serif text-xl">
        <svg viewBox="0 0 24 24" className={glyph} fill="currentColor" aria-hidden="true">
          <path d="M20 4C11 4 5 8 5 15c0 2 .6 3.6 1.5 5L4 22.5 5.5 24 8 21.5c1.3.9 3 1.5 5 1.5 7 0 9-8 7-19Z" transform="scale(.92) translate(1 -1)" />
        </svg>
        Orchard Row
      </span>
    ),
  },
  {
    name: "Brindle",
    mark: (
      <span className="flex items-center gap-1.5 text-2xl font-black tracking-tighter">
        <svg viewBox="0 0 24 24" className={glyph} fill="currentColor" aria-hidden="true">
          <path d="m12 2 8.66 5v10L12 22l-8.66-5V7L12 2Zm0 5.2L7.84 9.6v4.8L12 16.8l4.16-2.4V9.6L12 7.2Z" fillRule="evenodd" />
        </svg>
        brindle
      </span>
    ),
  },
  {
    name: "Kestrel",
    mark: (
      <span className="flex items-center gap-2 text-xl font-semibold">
        <svg viewBox="0 0 24 24" className={glyph} fill="none" stroke="currentColor" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
          <path d="m3 7 9 6 9-6M3 13l9 6 9-6" />
        </svg>
        Kestrel
      </span>
    ),
  },
  {
    name: "Saltmarsh",
    mark: (
      <span className="flex items-center gap-2 text-2xl font-light tracking-wide">
        <svg viewBox="0 0 24 24" className={glyph} fill="none" stroke="currentColor" strokeWidth="2.2" strokeLinecap="round" aria-hidden="true">
          <path d="M2 9c2.5-2 5-2 7.5 0s5 2 7.5 0 3.5-1.6 5-1M2 15c2.5-2 5-2 7.5 0s5 2 7.5 0 3.5-1.6 5-1" />
        </svg>
        Saltmarsh
      </span>
    ),
  },
];

const KEYFRAMES = "@keyframes chm-logo-marquee{to{transform:translate3d(-100%,0,0)}}";

export function LogoMarquee({
  title = "Operations teams at 4,000 companies plan their week in Paperlark",
  logos = DEFAULT_LOGOS,
  duration = 40,
  className,
}: LogoMarqueeProps) {
  const list = (copy: boolean) => (
    <ul
      aria-hidden={copy || undefined}
      className={cn(
        "flex shrink-0 items-center gap-14 pr-14 sm:gap-20 sm:pr-20",
        "motion-safe:animate-[chm-logo-marquee_var(--chm-logo-duration)_linear_infinite]",
        "group-hover/logos:[animation-play-state:paused]",
        copy
          ? "motion-reduce:hidden"
          : "motion-reduce:w-full motion-reduce:shrink motion-reduce:flex-wrap motion-reduce:justify-center motion-reduce:gap-x-12 motion-reduce:gap-y-8 motion-reduce:pr-0",
      )}
    >
      {logos.map((logo) => (
        <li key={logo.name} className="text-muted-foreground transition-colors duration-200 hover:text-foreground">
          {copy ? logo.mark : (
            <>
              <span className="sr-only">{logo.name}</span>
              <span aria-hidden="true">{logo.mark}</span>
            </>
          )}
        </li>
      ))}
    </ul>
  );

  return (
    <section aria-labelledby="logo-marquee-title" className={cn("bg-background py-16 sm:py-20", className)}>
      <style href="chm-logo-marquee" precedence="default">{KEYFRAMES}</style>
      <div className="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8">
        <h2 id="logo-marquee-title" className="mx-auto max-w-md text-balance text-center text-base font-medium text-muted-foreground">
          {title}
        </h2>
        <div
          style={{ "--chm-logo-duration": `${duration}s` } as CSSProperties}
          className="group/logos mt-10 flex overflow-hidden motion-safe:[mask-image:linear-gradient(to_right,transparent,#000_14%,#000_86%,transparent)]"
        >
          {list(false)}
          {list(true)}
        </div>
      </div>
    </section>
  );
}