Marquee
A strip of content that scrolls sideways in a loop, such as a row of logos.
<arc-marquee>Overview
Marquee scrolls its children horizontally in a loop. It copies them into a second group in its shadow DOM, and a CSS keyframe animation moves both groups, so the copy takes the original's place as it scrolls out with no visible seam.
speed is in pixels per second. Marquee measures the content's width and sets the animation's duration from it, so the speed is the same however much content you put in. A ResizeObserver measures again when the content changes size.
pause-on-hover is on by default and stops the animation while the pointer is over it. With prefers-reduced-motion, the animation stays paused. direction is "left" (the default) or "right", and gap takes any CSS length for the space between items.
Guidelines
Do
- Use it for decorative content like logo strips or scrolling testimonials
- Leave `pause-on-hover` on so people can stop on an item and read it
- Put in enough items to fill the width. Otherwise the gap before the copy shows
- Keep `speed` near its default of 40 pixels per second when the strip has text people need to read
- Turn on reduced motion and check that the paused strip looks right
Don't
- Don't put anything people must read in a marquee. Scrolling text is easy to miss
- Don't put buttons or links in it with `pause-on-hover` off. They're hard to click while they move
- Don't use it in place of a notification or an alert banner
- Don't stack marquees that move in different directions
Features
- The track sets `will-change: transform`
Preview
Usage
Marquee is in the marketing group, so the default @arclux/arc-ui entry point doesn't include it. Import it from@arclux/arc-ui/marketing or from its own subpath,@arclux/arc-ui/marquee.
<arc-marquee speed="40" direction="left" pause-on-hover>
<img src="/logos/partner-1.svg" alt="Partner 1" height="32" />
<img src="/logos/partner-2.svg" alt="Partner 2" height="32" />
<img src="/logos/partner-3.svg" alt="Partner 3" height="32" />
<img src="/logos/partner-4.svg" alt="Partner 4" height="32" />
</arc-marquee>import { Marquee } from '@arclux/arc-ui-react';
export default function Example() {
return (
<Marquee speed={40} direction="left" pauseOnHover>
<img src="/logos/partner-1.svg" alt="Partner 1" height="32" />
<img src="/logos/partner-2.svg" alt="Partner 2" height="32" />
<img src="/logos/partner-3.svg" alt="Partner 3" height="32" />
<img src="/logos/partner-4.svg" alt="Partner 4" height="32" />
</Marquee>
);
}<script setup>
import { Marquee } from '@arclux/arc-ui-vue';
</script>
<template>
<Marquee :speed="40" direction="left" pause-on-hover>
<img src="/logos/partner-1.svg" alt="Partner 1" height="32" />
<img src="/logos/partner-2.svg" alt="Partner 2" height="32" />
<img src="/logos/partner-3.svg" alt="Partner 3" height="32" />
<img src="/logos/partner-4.svg" alt="Partner 4" height="32" />
</Marquee>
</template><script>
import { Marquee } from '@arclux/arc-ui-svelte';
</script>
<Marquee speed={40} direction="left" pause-on-hover>
<img src="/logos/partner-1.svg" alt="Partner 1" height="32" />
<img src="/logos/partner-2.svg" alt="Partner 2" height="32" />
<img src="/logos/partner-3.svg" alt="Partner 3" height="32" />
<img src="/logos/partner-4.svg" alt="Partner 4" height="32" />
</Marquee>import { Component } from '@angular/core';
import { Marquee } from '@arclux/arc-ui-angular';
@Component({
imports: [Marquee],
template: `
<arc-marquee [speed]="40" direction="left" pause-on-hover>
<img src="/logos/partner-1.svg" alt="Partner 1" height="32" />
<img src="/logos/partner-2.svg" alt="Partner 2" height="32" />
<img src="/logos/partner-3.svg" alt="Partner 3" height="32" />
<img src="/logos/partner-4.svg" alt="Partner 4" height="32" />
</arc-marquee>
`,
})
export class MyComponent {}import { Marquee } from '@arclux/arc-ui-solid';
export default function Example() {
return (
<Marquee speed={40} direction="left" pauseOnHover>
<img src="/logos/partner-1.svg" alt="Partner 1" height="32" />
<img src="/logos/partner-2.svg" alt="Partner 2" height="32" />
<img src="/logos/partner-3.svg" alt="Partner 3" height="32" />
<img src="/logos/partner-4.svg" alt="Partner 4" height="32" />
</Marquee>
);
}import { Marquee } from '@arclux/arc-ui-preact';
export default function Example() {
return (
<Marquee speed={40} direction="left" pauseOnHover>
<img src="/logos/partner-1.svg" alt="Partner 1" height="32" />
<img src="/logos/partner-2.svg" alt="Partner 2" height="32" />
<img src="/logos/partner-3.svg" alt="Partner 3" height="32" />
<img src="/logos/partner-4.svg" alt="Partner 4" height="32" />
</Marquee>
);
}<!-- Auto-generated by @arclux/prism — do not edit manually -->
<!-- arc-marquee — requires marquee.css + tokens.css (or arc-ui.css) -->
<div class="arc-marquee">
</div><!-- Auto-generated by @arclux/prism — do not edit manually -->
<!-- arc-marquee — self-contained, no external CSS needed -->
<div class="arc-marquee">
</div>API
gapstring'var(--space-xl)'- CSS length value for the gap between slotted items. Accepts any valid CSS length or custom property.
speednumber40- Scroll speed in pixels per second. The animation duration is calculated from the content width divided by this value.
direction'left' | 'right''left'- Scroll direction.
leftscrolls content from right to left (default),rightreverses the direction. pauseOnHoverbooleantrue- When true, the animation pauses while the cursor hovers over the marquee.