Marquee

A row that slides on a seamless loop at a speed in pixels per second, and holds still under the pointer or focus.

SpringsShadersSignpostsShelvesTimelinesTerminals

Features

  • Two copies of the row slide by one copy and the gap, so the loop has no seam.
  • Speed in pixels per second, from the row's measured width: longer rows take longer.
  • Pauses under the pointer, on focus inside, when play is false and for reduced motion.
  • Edges fade with a mask instead of hard cuts.

Use it for

  • Testimonials, logos, release notes.

Installation

  1. Get runets.
    git clone https://github.com/ziyam-khan/runets
  2. Copy these files into your project, keeping their folders.
  3. Install what they use.
    pnpm add react
  4. Load the styles once. Bring your own base tokens, or use runets’ default theme.
    import 'runets/styles/theme.css'
    import 'runets/styles/kit.css'

API

PropTypeWhat it does
speednumberPixels per second (40).
playbooleanRun or hold; hold it while off screen.
gapnumberPixels between items (16).
labelstringNames the region for assistive tech.

Accessibility

Source

The code is in src/kit/marquee.tsx in runets, MIT licensed.