Marquee
Scroll a row of items endlessly; pauses on hover and stops for reduced motion.
SourceStyles source@monoline/react 0.5.0Markdown for AI toolsstable
- 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
| Prop | Type | Default | Description |
|---|---|---|---|
duration | number | 30 | Seconds for one full loop. |
reverse | boolean | – | Scroll to the right instead of the left. Default false. |
pauseOnHover | boolean | true | Stop 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.
| Attribute | Stylesheet |
|---|---|
[aria-hidden="true"] | marquee.css |
CSS classes
| Class | Stylesheet |
|---|---|
.marquee | marquee.css |
.marquee-pause | marquee.css |
.marquee-reverse | marquee.css |
.marquee-track | marquee.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.