Skip to content

Marquee

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

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

From the Nitip template, see it in context.

NorthwindLumenArcadiaKestrelHaldenOakmereNorthwindLumenArcadiaKestrelHaldenOakmere

Examples

Vertical

A column in a small window: the lines roll up, one after another, with faded edges.

I specialize in
Brand photographyEditorial designCreative directionWeb designBrand photographyEditorial designCreative directionWeb design
<Marquee direction="up" speed={12} gap={8} fade className="h-16 w-52">
  {specialities.map((name) => (
    <span key={name} className="block h-8 leading-8 whitespace-nowrap">{name}</span>
  ))}
</Marquee>

On hover

Two photo columns stand still and roll, one up and one down, only while the pointer is on the card.

Portrait sessions

Hover the card and the photos roll.

From $900
<Marquee direction="up" run="hover" hoverTarget=".group" speed={14} gap={8} className="h-full w-14">
  {photos.map((photo) => <img key={photo} src={photo} alt="" className="h-20 w-14 rounded-md object-cover" />)}
</Marquee>

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 size.
direction"left" | "right" | "up" | "down""left""left" and "right" run a row; "up" and "down" run a column and need a height of their own (className="h-6").
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. Not with run="hover".
run"always" | "hover""always""hover" stands at its start and runs only while the pointer or the keyboard focus is on it, then stops and jumps back to the start at once (Marai Neesu's service photos).
hoverTargetstring—With run="hover": a selector for the nearest ancestor whose hover and focus wake it (".group", "[data-card]"); the marquee itself when left out.
fadebooleanfalseFade both edges into the background.
  • With reduced motion enabled it stands still.
  • The second copy is hidden from screen readers and inert.
  • run="hover" is Marai Neesu's service card: two photo columns, one rolling up and one down at 5 px/s there, that stand still until the pointer is on the card and jump back to the start when it leaves. Keyboard focus inside starts it too. hoverTarget=".group" makes the whole card the trigger; without it only the strip of photos wakes them.
  • "up" and "down" are Tustel's vertical ticker (5 px/s, its specialities rolling up a one-line window): the track is a column, the loop moves it on the Y axis, and the fade mask runs top to bottom. A column needs a height; a row takes the width of its container.

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 ticker, sideways or up and down), 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.
- direction "up" and "down" run a column instead: the track is flex-col (not w-max), each group is flex-col with the gap as
  padding-bottom, the animation is translateY 0% → -50% (up) or -50% → 0% (down), and the duration uses the track's
  height. The caller gives the marquee a height.
- pauseOnHover: tween the animation's playbackRate to 0 over 0.5s ease-out on pointer enter, back to 1 on leave.
- run "hover": create the animation paused (playbackRate 0) at its start; pointerenter or focusin on the host sets playbackRate 1;
  pointerleave, or focusout to somewhere outside the host, sets it back to 0 and currentTime to 0 (a jump back to the start). The host is
  the marquee itself, or with a hoverTarget selector its nearest ancestor that matches (element.closest), so a whole card can wake it.
- fade: mask-image linear-gradient (to right, or to bottom for a column) 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