Skip to main content
Version: Next

Marquee

ui-marquee is the framework-agnostic infinite scrolling rail from @editora/ui-core. It supports horizontal and vertical directions, mixed content, reduced-motion safeguards, clone sanitization, and the same tokenized visual system used by other surface components.

Import

import '@editora/ui-core';

Basic Usage

<ui-marquee speed="72" gap="20" pause-on-hover fade>
<div data-ui-marquee-item>Realtime collaboration synced</div>
<div data-ui-marquee-item>Release train ready for sign-off</div>
<div data-ui-marquee-item>ICU occupancy crossed 85%</div>
</ui-marquee>

Mixed Content

<ui-marquee variant="glass" tone="info" size="lg" gap="24" speed="58" fade pause-on-hover>
<article data-ui-marquee-item>
<img src="/launch-poster.png" alt="Launch poster">
<h3>Editorial launch rail</h3>
<p>Use richer card-like items when the marquee acts as a moving shelf.</p>
</article>

<article data-ui-marquee-item>
<video src="/preview.mp4" muted autoplay loop playsinline></video>
</article>
</ui-marquee>

Vertical Feed

<ui-marquee
direction="up"
variant="contrast"
tone="info"
speed="42"
gap="16"
fade
style="block-size: 360px;"
>
<article data-ui-marquee-item>
<strong>Deployment 4.2.1</strong>
<span>Canary rollout reached 60% of premium traffic.</span>
</article>
<article data-ui-marquee-item>
<strong>Policy drift check</strong>
<span>Two workspaces still need the updated retention package.</span>
</article>
</ui-marquee>

Attributes

AttributeTypeDefaultDescription
directionleft | right | up | downleftScroll direction
speednumber60Pixels per second
gapCSS length24pxGap between items
pausedbooleanfalsePauses animation
pause-on-hoverbooleanfalsePauses on hover
pause-on-focusbooleanfalsePauses on focus within
fadebooleanfalseEnables edge fading
fade-sizeCSS length48pxFade mask size
variantdefault | surface | soft | solid | glass | contrast | minimaldefaultSurface styling
tonebrand | neutral | info | success | warning | dangerbrandAccent tone
sizesm | md | lg | 1 | 2 | 3mdShell and item sizing
radiusCSS length or semantic tokenShell radius override
elevationnone | low | highlowSurface shadow depth
paddingCSS lengthShell padding override

Methods

const marquee = document.querySelector('ui-marquee');
marquee?.pause();
marquee?.play();
marquee?.refresh();

Notes

  • Add data-ui-marquee-item to content wrappers for the built-in item styling treatment.
  • The component duplicates slotted content internally to create a seamless loop.
  • Interactive content inside clones is sanitized and hidden from assistive technology to avoid duplicate focus targets.
  • Reduced-motion environments automatically suppress animation.