Marquee

Seamless loop whose speed is a spring: hover brakes it, leaving releases it. Effects.

Open playground
BriefBlockMovePolishShipRepeat

About

Marquee is a React component in the Effects category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { Marquee } from "@ashutoshswamy/smoui" and set children, duration, reverse among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { Marquee } from "@ashutoshswamy/smoui";

<Marquee duration={14}>
  <span>Brief</span>
  <span>Block</span>
  <span>Move</span>
</Marquee>

Props 4

children

Items to loop. Must be wider than the container.

ReactNode
duration

Seconds per loop.

numberdefault 20
reverse

Scroll right.

booleandefault false
slowOnHover

Brake to a crawl under the pointer.

booleandefault true