Playground

Marquee

Scroll a row of items endlessly; pauses on hover and stops for reduced motion.

  • Built on native elements
  • The duplicate copy is aria-hidden so screen readers read the items once.
  • Pauses on hover and focus; animation is off under prefers-reduced-motion.
  • Styles in one file: marquee.css

Import

import '@monoline/css';
import {Marquee} from '@monoline/react';

Not installed yet? Pick a route.

Copies the source and its styles into your project.

npx monoline add marquee

Usage

import {Marquee} from '@monoline/react';

<Marquee duration={20}>
  {['Acme', 'Globex', 'Initech', 'Umbrella', 'Hooli'].map((n) => <span key={n} style={{padding: '0 var(--s5)', fontFamily: 'var(--font-display)'}}>{n}</span>)}
</Marquee>

Examples

Names

Props

MarqueeProps

PropTypeDefaultDescription
durationnumber30Seconds for one full loop.
reverseboolean–Scroll to the right instead of the left. Default false.
pauseOnHoverbooleantrueStop when the pointer is over it or focus is inside. Default true.

Data Attributes

State is exposed through attributes. Style it with these selectors, not with class toggles.

AttributeStylesheet
[aria-hidden="true"]marquee.css

CSS classes

ClassStylesheet
.marqueemarquee.css
.marquee-pausemarquee.css
.marquee-reversemarquee.css
.marquee-trackmarquee.css

Customization

Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.

app.css
.marquee {
  border-color: var(--accent);
}
.marquee[aria-hidden="true"] {
  background: var(--wash);
}

Accessibility

  • The duplicate copy is aria-hidden so screen readers read the items once.
  • Pauses on hover and focus; animation is off under prefers-reduced-motion.