Components / Layout
Marquee
An endlessly scrolling row of content with faded edges that pauses on hover.
ReactNext.jsTailwindMotionTypeScriptVite
Installation
Requires React 18+ and Tailwind CSS.
- 1
Install dependencies
$ npm install motion - 2
Add the component
Copy the code from the Code tab above into
components/ui/marquee.tsx. - 3
Use it
example.tsximport { Marquee } from "@/components/ui/marquee"; const items = ["React", "Next.js", "Tailwind", "Motion", "TypeScript", "Vite"]; export default function MarqueeDemo() { return ( <Marquee className="w-full max-w-xl"> {items.map((item) => ( <span key={item} className="rounded-full border border-zinc-200 dark:border-white/10 bg-white dark:bg-zinc-900 px-4 py-2 text-sm text-zinc-700 dark:text-zinc-300" > {item} </span> ))} </Marquee> ); }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | Items to scroll. |
| duration | number | 20 | Seconds for one full loop. |
| reverse | boolean | false | Scroll left-to-right instead. |
| pauseOnHover | boolean | true | Pause while the pointer is over it. |