Client component

Marquee

An infinitely scrolling strip for logos and highlights: CSS-driven, pausable, gradient-masked.

React
TypeScript
Vitest
Vite
Next.js
CVA
pnpm

Import#

import { Marquee } from "astralis-ui";
// Marquee.Item

Usage#

Children are duplicated once (the clone is aria-hidden) for a seamless loop; the animation is pure CSS keyframes, so it costs nothing at runtime. gradient masks the edges into the background.

Opposing rows#

Semantic tokens
Runtime theming
Dark mode
Responsive props
Compound components
Accent channel
Zero build step
Typed styles

Props#

PropTypeDefaultDescription
direction"left" | "right" | "up" | "down""left"Scroll axis and direction.
speednumber50Pixels per second.
gapstring"1rem"CSS length between items, and at the loop seam.
reversebooleanfalseFlips the direction.
pauseOnHoverbooleanfalsePauses while the pointer is over the strip.
pauseOnFocusbooleanfalsePauses while focus is inside. Turn it on when items are interactive.
gradientbooleanfalseFades both edges into the background.
gradientColorstringpage backgroundCSS color the edges fade into.
gradientWidthstring"10%"Width of each edge fade.
loopCountnumber0Loops before the strip stops. 0 loops forever.

Parts#

PropTypeDefaultDescription
Marquee.Itemdiv propsNoneOne entry in the strip. The items are rendered twice for a seamless loop, and the copy is hidden from assistive technology.

Accessibility#

The duplicated track is aria-hidden, and pauseOnFocus lets keyboard users freeze the motion. Turn it on when items are interactive.