All components

Marquee

A smooth, endlessly looping scroller ideal for showcasing logos, testimonials, images, or sponsor lists. Features auto-play with customizable speed, pause-on-hover, reverse direction, and seamless loop behavior.

Pro Marketing Figma ReactFree
Open in New Tab

components/shadcncraft/pro-marketing/marquee.tsx

"use client";

import { cn } from "@/lib/utils";

interface MarqueeProps extends React.ComponentProps<"div"> {
  /**
   * Direction of the animation
   * @default "horizontal"
   */
  direction?: "horizontal" | "vertical";
  /**
   * Whether to reverse the animation direction
   * @default false
   */
  reverse?: boolean;
  /**
   * Whether to pause the animation on hover
   * @default false
   */
  pauseOnHover?: boolean;
  /**
   * Number of times to repeat the content
   * @default 4
   */
  repeat?: number;
}

function Marquee({
  className,
  reverse = false,
  pauseOnHover = false,
  children,
  direction = "horizontal",
  repeat = 4,
  ...props
}: MarqueeProps) {
  return (
    <div
      role="marquee"
      data-slot="marquee"
      data-direction={direction}
      data-reverse={reverse}
      data-pause-on-hover={pauseOnHover}
      data-repeat={repeat}
      className={cn(
        "group/marquee flex w-full min-w-0 gap-(--gap) overflow-hidden [--duration:20s] [--gap:1.25rem]",
        direction === "horizontal" ? "flex-row" : "flex-col",
        "has-data-[fade='left']:mask-l-from-80%",
        "has-data-[fade='right']:mask-r-from-80%",
        "has-data-[fade='top']:mask-t-from-80%",
        "has-data-[fade='bottom']:mask-b-from-80%",
        "has-data-[fade='vertical']:mask-y-from-80%",
        "has-data-[fade='horizontal']:mask-x-from-80%",
        className
      )}
      {...props}
    >
      {Array(repeat)
        .fill(0)
        .map((_, i) => (
          <div
            key={i}
            data-slot={`marquee-repeat-${i + 1}`}
            className={cn("flex min-w-0 shrink-0 justify-around gap-(--gap)", {
              "animate-marquee flex-row": direction === "horizontal",
              "animate-marquee-vertical flex-col": direction === "vertical",
              "group-hover/marquee:paused": pauseOnHover,
              "direction-[reverse]": reverse,
            })}
          >
            {children}
          </div>
        ))}
    </div>
  );
}

function MarqueeFade({
  fade,
}: {
  fade: "left" | "right" | "top" | "bottom" | "horizontal" | "vertical";
}) {
  return (
    <div
      data-slot="marquee-fade"
      data-fade={fade}
      className="hidden"
      aria-hidden="true"
    />
  );
}

export { Marquee, MarqueeFade };

Marquee is available as part of our Pro and Pro + React Design Systems. Get Marquee

Benefits

Placeholder title

Lorem ipsum, dolor sit amet consectetur adipisicing elit. Esse rerum voluptatum id. Facilis commodi explicabo recusandae.

Structured Layouts

Clear grids, consistent spacing, and predictable hierarchy.

Marketing + App Coverage

Landing pages, dashboards, onboarding, pricing, e-commerce, and more.

Theme Compatible

Works seamlessly with semantic tokens and theming.

Production-Ready States

Designed with real content, tokenized spacing, and real interaction patterns.

Figma + React Parity (Pro + React)

Design in Figma and ship with aligned React components.

Composable by Design

Mix blocks together to create complete pages without layout conflicts.

Frequently Asked Questions

Quick FAQs to get you started.
Still have questions? See all FAQs, or get support.

Yes. They follow shadcn/ui structure and are built for real products.

SBIOTJ

Join 3,000+ builders shipping with shadcncraft

Design and assemble full pages faster with production-ready blocks built for real products.

  • Production-ready blocks and components
  • Clean React and Tailwind parity
  • Built for SaaS, marketing, and ecommerce teams
Get the design system
Join Now CTA

Real support from the team behind shadcncraft

Get help within 24 hours from the people who build and maintain the system.

Email
Prefer a direct line? Send us a message and we'll get back to you as soon as possible.
Discord
Get quick support, share feedback, or connect with other builders.
Feedback
Got something to say about anything shadcncraft? We'd love to hear it.