Skip to content

Marquee

A row of content that scrolls past on a loop.

Northwind
Cobalt
Evergreen
Summit
Nimbus
Ember
Quanta
Crate

Installation

  1. Add the registryOnce per project
  2. Add marquee

Usage

The marquee repeats its children as many times as it takes to fill it, so the loop never shows a gap. It moves them speed pixels per second with the Web Animations API, so the browser runs the animation off the main thread. Set --marquee-gap on the marquee to change the space between items, and --marquee-fade to change how far in from each end the content fades. Turn the fade off with fade={false}.

The marquee slows to a stop while the pointer is over it or a finger touches it, unless you set pauseOnHover={false}. It also stops while something inside it has keyboard focus, and scrolls the focused element into view. Screen readers read the content once, since the copies are hidden from them and are left out of the tab order. Users can still click or tap the links and buttons in every copy.

For users who ask their system to reduce motion, the marquee stays still. If they need to reach content that doesn't fit, set drag or wheel, or add a pause button. Moving content that runs for more than a few seconds needs a way to stop it.

Examples

Reverse

reverse moves the content toward the end instead of the start.

ReactVueSvelteSolidAngularAstroQwikPreact
ViteTurbopackesbuildRollupBunDenoNode.jspnpm

Drag and scroll

drag lets users grab and fling the marquee, or swipe it on a touch screen. wheel lets them scroll it with a mouse wheel or trackpad. A drag that moves the marquee doesn't count as a click on the content inside it.

Blue and greenYellow and redLight and dark bluePale and deep greenCream and goldPink and crimson

Vertical

Set orientation="vertical" to move the content upward, and give the marquee a height.

Setup took five minutes, and the defaults were already what we wanted.
TSTony Stark
Our designers and engineers finally agree on what a button looks like.
APAda Park
We replaced three internal libraries with it in a week.
SRSam Rivera
The docs answer the question before I think to ask it.
PSPriya Shah
Dark mode just worked, which has never happened to me before.
JKJonah Kim

Pause button

paused stops the marquee, easing to a stop as it does on hover.

APIOperationalDashboardOperationalBuildsDegradedEdge networkOperationalWebhooksOutageStorageOperational

Props

Base UI's styling (opens in a new tab) and composition (opens in a new tab) guides say more about className, style and render.

Marquee