Marquee

An infinite scrolling component that can be used to display text, images, or videos.

Vercel
Next.js
React
shadcn/ui
Tailwind CSS
TypeScript
Vercel
Next.js
React
shadcn/ui
Tailwind CSS
TypeScript
Vercel
Next.js
React
shadcn/ui
Tailwind CSS
TypeScript
Vercel
Next.js
React
shadcn/ui
Tailwind CSS
TypeScript
Supabase
Stripe
GitHub
OpenAI
Claude
Cursor
Supabase
Stripe
GitHub
OpenAI
Claude
Cursor
Supabase
Stripe
GitHub
OpenAI
Claude
Cursor
Supabase
Stripe
GitHub
OpenAI
Claude
Cursor

Installation

Cortexcn
pnpm dlx shadcn@latest add @cortexcn/marquee

The CLI also adds the animate-marquee and animate-marquee-vertical animations to your globals.css. For a manual install, copy the CSS shown in the Manual tab.

Usage

import { Marquee } from "@/components/marquee";
<Marquee pauseOnHover>
  <span>Next.js</span>
  <span>React</span>
  <span>Tailwind CSS</span>
</Marquee>

Examples

Two rows

Pair a normal row with a reverse row, then fade the edges with gradients.

Vercel
Next.js
React
shadcn/ui
Tailwind CSS
TypeScript
Vercel
Next.js
React
shadcn/ui
Tailwind CSS
TypeScript
Vercel
Next.js
React
shadcn/ui
Tailwind CSS
TypeScript
Vercel
Next.js
React
shadcn/ui
Tailwind CSS
TypeScript
Supabase
Stripe
GitHub
OpenAI
Claude
Cursor
Supabase
Stripe
GitHub
OpenAI
Claude
Cursor
Supabase
Stripe
GitHub
OpenAI
Claude
Cursor
Supabase
Stripe
GitHub
OpenAI
Claude
Cursor
<div className="relative flex w-full flex-col overflow-hidden">  <Marquee pauseOnHover className="[--duration:30s]">    {firstRow.map((logo) => (      <LogoCard key={logo.name} {...logo} />    ))}  </Marquee>  <Marquee reverse pauseOnHover className="[--duration:30s]">    {secondRow.map((logo) => (      <LogoCard key={logo.name} {...logo} />    ))}  </Marquee>  <div className="pointer-events-none absolute inset-y-0 left-0 w-1/4 bg-linear-to-r from-background" />  <div className="pointer-events-none absolute inset-y-0 right-0 w-1/4 bg-linear-to-l from-background" /></div>

Vertical

Set vertical to scroll top to bottom. Give the parent a fixed height.

Open code
Composable
Beautiful defaults
AI-ready
Dark mode
Copy and paste
Open code
Composable
Beautiful defaults
AI-ready
Dark mode
Copy and paste
Open code
Composable
Beautiful defaults
AI-ready
Dark mode
Copy and paste
Open code
Composable
Beautiful defaults
AI-ready
Dark mode
Copy and paste
Open code
Composable
Beautiful defaults
AI-ready
Dark mode
Copy and paste
Open code
Composable
Beautiful defaults
AI-ready
Dark mode
Copy and paste
Open code
Composable
Beautiful defaults
AI-ready
Dark mode
Copy and paste
Open code
Composable
Beautiful defaults
AI-ready
Dark mode
Copy and paste
<div className="relative flex h-72 w-full items-center justify-center gap-4 overflow-hidden">  <Marquee vertical pauseOnHover className="[--duration:20s]">    {features.map((feature) => (      <Card key={feature}>{feature}</Card>    ))}  </Marquee>  <Marquee vertical reverse pauseOnHover className="[--duration:20s]">    {features.map((feature) => (      <Card key={feature}>{feature}</Card>    ))}  </Marquee></div>

Speed and spacing

The marquee reads two CSS variables. Override them with a class:

<Marquee className="[--duration:20s] [--gap:2rem]">{children}</Marquee>
VariableDefaultDescription
--duration40sTime for one full loop. Lower is faster.
--gap1remSpace between items and between repeated sets

Props

PropTypeDefaultDescription
childrenReactNoderequiredContent to scroll
reversebooleanfalseScroll in the opposite direction
pauseOnHoverbooleanfalsePause the animation while hovered
verticalbooleanfalseScroll vertically instead of horizontally
repeatnumber4How many copies of the content are rendered
classNamestring-Extra classes, including --duration/--gap

All other div props are passed to the root element.