Scrolling Content
An infinite marquee — hover to pause, drag to scrub, no dependencies.
v2.1.1@magic-spells/scrolling-content
Live demo
Drag to scrub the marquee back and forth.
About
An infinite scrolling marquee web component. Loops any row of markup forever — logo walls, tickers, announcement bars — with hover-to-pause, drag-to-scrub, and a speed you can set from a media query.
Features
- Measures your content and clones it until the track covers the container — six items or sixty, same markup
- Adopts markup you authored yourself, so it never fights a framework that owns the DOM
- Edit the content and every clone follows on the next frame
- Speed in px/sec, overridable per breakpoint from CSS
- Hover to pause, drag to scrub, both opt-out-able
- Optional edge fade so content dissolves instead of clipping
Usage
<scrolling-content speed="60" fade>
<scrolling-track>
<span>🚀 Web Components</span>
<span>⚡ Lightning Fast</span>
<span>🎨 Fully Customizable</span>
</scrolling-track>
</scrolling-content>Configuration
| Attribute | Default | Description |
|---|---|---|
| speed | 60 | Scroll speed in pixels per second. Overridden by --scrolling-content-speed when that property is set. |
| direction | left | left or right. |
| paused | absent | Boolean. Reflected — this is the state start() and stop() write. |
| pause-on-hover | true | Set "false" to keep scrolling under the cursor. |
| drag | true | Set "false" to disable scrubbing. |
| fade | absent | Boolean, or a CSS length. Masks the left and right edges. Bare fade uses 4rem. |
About, features, usage and options are taken from the package README.