Skip to content

Marquee

Content that scrolls sideways forever at a steady speed, with an optional glide to a stop on hover.

From the Nitip template — see it in context
NorthwindLumenArcadiaKestrelHaldenOakmereNorthwindLumenArcadiaKestrelHaldenOakmere

Installation

$ npx shadcn@latest add https://framebrick.co/r/marquee.json

Usage

import { Marquee } from "@/components/ui/marquee";

<Marquee speed={40} pauseOnHover fade>
  {logos.map((logo) => <img key={logo.src} src={logo.src} alt={logo.name} className="h-8" />)}
</Marquee>

Props

PropTypeDefaultDescription
speednumber40Pixels per second — the same whatever the content width.
direction"left" | "right""left"Scroll direction.
gapnumber32Space between items, in px.
repeatnumber2Copies of the children per loop half; raise it for short content.
pauseOnHoverbooleanfalseGlide to a stop while hovered, then speed back up.
fadebooleanfalseFade both edges into the background.
  • With reduced motion enabled the row stands still.
  • The second copy is hidden from screen readers and inert.

AI prompt

Paste into v0, Lovable, Bolt or Claude to rebuild this component in your own project.

Create a React + Tailwind CSS component called Marquee (infinite horizontal ticker), using the Web Animations API.
- Outer div overflow-hidden; inner track w-max flex with two identical groups of the children (second copy aria-hidden and inert).
  Each group repeats the children N times with a gap and padding-right equal to the gap, so the loop is seamless.
- Animate the track translateX 0% → -50% (or reverse for direction right), linear, infinite.
  Duration = (track width / 2) / speed in px per second. Re-create the animation on resize (ResizeObserver),
  keeping the current progress so it doesn't jump.
- pauseOnHover: tween the animation's playbackRate to 0 over 0.5s ease-out on pointer enter, back to 1 on leave.
- fade: mask-image linear-gradient transparent → black 10% → black 90% → transparent.
- Respect prefers-reduced-motion: no animation.

Be the first to know

Get new templates and components first

One short email when we release a template or a free component. No spam — unsubscribe anytime.

We use your email only for Framebrick updates. Privacy policy