Skip to content
English
Marquee comes with Pro. Its preview shows once you unlock it.

How it works

The track holds two identical groups; a CSS animation moves it from 0 to -50%, exactly one group, and back seamlessly. Short content is repeated inside each group so there is never a gap. Duration is group length ÷ speed, measured again with a ResizeObserver, so the speed in pixels per second holds for any content; changing it keeps the current progress. Copies are aria-hidden and inert. The fade uses mask-image, so it works on any background.

Use it for

  • Showing partner names, logos or press mentions on a marketing page.
  • Decorative areas that rotate many tags in limited space.
  • A scrolling announcement strip at the top of a page (vertical).

Look elsewhere when

  • Important information people must read or click: moving content is easy to miss.
  • More than two on one screen: several moving areas distract.
  • Lists that people browse and compare item by item: use plain scrolling or a grid.

Usage

import { Marquee } from './Marquee.jsx'

export function Cities({ cities }) {
  return (
    <Marquee speed={40} direction="left" pauseOnHover fade>
      {cities.map((city) => (
        <CityTag key={city.id} city={city} />
      ))}
    </Marquee>
  )
}

// Vertical: give it a fixed height
<Marquee direction="up" style={{ height: 160 }}>{notices}</Marquee>

Props

PropTypeDefaultWhat it does
speednumber40Scroll speed in pixels per second, independent of content length.
direction'left' | 'right' | 'up' | 'down''left'Scroll direction. Vertical needs a fixed height on the component.
pauseOnHoverbooleantruePauses while the pointer is over it. Keyboard focus always pauses.
fadebooleantrueFades both ends with a mask.
fadeSizenumber48Length of the fade area in px.
gapnumber12Space between items in px, the same at the loop seam.
pausedbooleanfalsePauses from outside, for example from a “pause scrolling” button.
childrenReactNode—The scrolling content: a set of elements side by side.
...restHTMLAttributes—Other attributes go to the root element, such as className, style and role.

Accessibility

  • Only the first copy is visible to screen readers; the others are aria-hidden and inert, so nothing is read twice or reached by Tab.
  • Keyboard focus pauses it automatically, and the paused prop lets you add a pause button (WCAG 2.2.2).
  • Hover pause applies only on devices that can hover, so touch never gets stuck paused.
  • With reduced motion it does not scroll by itself, copies and fade are removed, and people scroll by hand.

Motion

Constant speed (linear, otherwise each loop would hitch at the seam); duration is group length ÷ speed. Changing speed keeps progress; hover or focus pauses instantly.

Add it to your project

Pro members copy a prompt and their coding agent installs the source, the same way as the free components.

Marquee.jsxmarquee.csstokens.cssREADME.md

Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.

Lists & layout
Arc carousel comes with Pro. Its preview shows once you unlock it.
Cylinder carousel comes with Pro. Its preview shows once you unlock it.