Marquee scrolls any row of content horizontally forever, duplicating children so the loop is seamless in both directions. It supports drag interaction that pauses and reverses the scroll, per-direction speeds, pause on hover, and edge fade masks. Built with Framer Motion and Tailwind CSS. The standard building block for logo strips, testimonial rows, and feature tickers on landing pages.
Installation
Examples
Horizontal Marquee
Usage
import { Marquee } from "@/components/ui/marquee";export default function MyComponent() {
return (
<Marquee>
{/* Your marquee content goes here */}
<div className="px-4">Content Item 1</div>
<div className="px-4">Content Item 2</div>
<div className="px-4">Content Item 3</div>
</Marquee>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | undefined | Content to be displayed in the marquee |
gap | number | 16 | Space between repeated content in pixels |
speed | number | 100 | Animation speed (higher is faster) |
speedOnHover | number | undefined | Animation speed when hovered (higher is faster) |
direction | "horizontal" | "vertical" | "horizontal" | Scrolling direction |
reverse | boolean | false | Reverse the animation direction |
className | string | undefined | Additional CSS classes to apply |
fadeEdges | boolean | false | Fade the edges of the marquee content |
fadeWidth | number | 64 | Width of the edge fade in pixels |
pauseOnTap | boolean | true | Pause animation when clicked |
draggable | boolean | true | Allow dragging interaction with the marquee |
