Searching Puzzle Pieces

Type to search Puzzle Pieces.

Marquee

A continuously scrolling ticker of content — logos, announcements, testimonials. The items are the component's default-slot children; they are cloned to loop seamlessly. It pauses on hover, supports drag-to-scrub, and honors prefers-reduced-motion (no auto-scroll). The piece wraps the @magic-spells/scrolling-content web component rather than reimplementing it.

AcmeGlobexInitechUmbrellaSoylentHooli

Installation

Copy the piece into your app — it compiles with your build and the code is yours:

puzzle add piece marquee

It has one runtime dependency — the web component it wraps:

npm install @magic-spells/scrolling-content

Then merge its stylesheet into your app's style entry. It is required: the host's overflow, the track's max-content sizing that the clone measurement is derived from, the gap variable, the drag cursors and the edge-fade mask all live there.

/* app/styles/styles.css */
@import "@magic-spells/scrolling-content/css" layer(components);

Requires the pieces.css tokens merged into your app styles (see Introduction).

Usage

import Marquee from '@/components/ui/Marquee.pzl';
<Marquee class="w-full rounded-xl border border-border bg-surface py-4"></Marquee>

Direction

OneTwoThreeFourFiveSix

Announcement bar

Free shipping on orders over $50New winter collection now liveMembers get 20% off this weekRefer a friend, get $10 credit

Pause on hover (off)

Keeps scrolling even under the pointerSet pauseOnHover to falseDefault is true

Speed

Slow — 20 px/secSlow — 20 px/secSlow — 20 px/secFast — 90 px/secFast — 90 px/secFast — 90 px/sec

Edge fade

DissolvesInsteadOfClippingAtTheEdges

Gap

Wide spacingBetween itemsAnd between copies

Live content

Free shipping on orders over $50Every clone rebuilds on the next frame

Behavior

  • Seamless loop — the slotted content is measured and cloned enough times to overfill the viewport; the track wraps by exactly one copy's width so there is never a gap
  • Pause on hover — the scroll stops while the pointer is over the marquee (mouse only); disable with pauseOnHover={ false }
  • Drag to scrub — press and drag horizontally to move the ticker by hand; touch drags the marquee while still letting the page scroll vertically. Opt out with drag={ false }
  • Clones are inert — every filler copy carries data-clone, aria-hidden and inert, with ids stripped, so a cloned link is never a focus stop
  • Edits rebuild the clones — change the slotted content and every copy is rebuilt on the next frame, automatically
  • Reduced motion — under prefers-reduced-motion the auto-scroll never starts; the content renders static and the duplicate copies are aria-hidden so assistive tech reads the sequence once