Marquee

Scrolls content continuously across the screen, such as a row of logos.

Usage

Code
import { Marquee } from '@leverui/components';
Code
<Marquee.Root>
  <Marquee.Viewport>
    <Marquee.Content>
      <Marquee.Item />
    </Marquee.Content>
  </Marquee.Viewport>
</Marquee.Root>

Examples

Reversed

Use the reverse prop on the Marquee.Root component to reverse the direction of the marquee.

Vertical Animation

To animate content along the Y axis, use the side prop and set it to bottom.

Speed

Use the speed prop to control the animation speed in pixels per second.

Slow (25px/s)
Normal (50px/s)
Fast (100px/s)

Pause On Interaction

Use the pauseOnInteraction prop to pause the animation when the user hovers or focuses the marquee.

Store

Use the Marquee.RootProvider and useMarquee hook to provide the marquee instance to the component and control the animation state programmatically.

Finite Loops

To loop the marquee a finite number of times, set the loopCount prop on Marquee.Root. Alternatively, use the onLoopComplete and onComplete callbacks to track the number of completed loops or when the animation fully finishes.

Loops completed: 0

Animations completed: 0

Code
<Marquee.Root
  loopCount={3}
  onLoopComplete={() => {
    /* handle loop completion */
  }}
  onComplete={() => {
    /* handle animation end */
  }}
>
  {/* Marquee.Item elements */}
</Marquee.Root>

Edge Gradient

Render the Marquee.Edge component to apply an edge fade.

Multiple

Here's an example of how to render alternating marquee components.

Diagonal

Here's an example of how to animate content diagonally using the marquee component.

Lever UI Conf 2026
Lever UI Conf 2026
Lever UI Conf 2026
Lever UI Conf 2026
Lever UI Conf 2026
Lever UI Conf 2026
Lever UI Conf 2026
Lever UI Conf 2026
Lever UI Conf 2026
Lever UI Conf 2026

News Ticker

Here's an example of how to implement a news ticker with the marquee component.

LATEST NEWS
City council approves new bike lanes
Library extends its weekend hours
Harbor bridge reopens after repairs
Farmers market returns this Saturday
Storm warning issued for the coast

Image Gallery

Here's an example of a 3D perspective image gallery with multiple vertical marquees scrolling in alternating directions.

Testimonials

You can display testimonials with the marquee component.

"We rebuilt our settings pages in a week. The components were easy to restyle for our brand."

IC
Iris Calder
Product designer

"The marquee took ten minutes to set up, and it pauses when you hover over it."

TP
Theo Park
Frontend developer

"Keyboard support worked from the start. Our accessibility review found little to fix."

NQ
Nadia Quill
CTO

"Our landing page was ready two days early, and the team can edit it themselves."

OB
Oskar Brandt
Marketing lead

"The docs answered most of my questions. I built my first version in one weekend."

RS
Rhea Solano
Solo founder

RTL Support

The marquee component supports RTL (right-to-left) layouts. Wrap the component with LocaleProvider to enable RTL mode.

مرحبا بكم
تصميم جميل
سهل الاستخدام
مكونات قابلة للوصول
أداء عالي
تجربة مستخدم رائعة

Guide

CSS Variables

Code
<Marquee.Root
  style={{
    '--leverui-marquee-duration': '30s',
    '--leverui-marquee-delay': '0s',
    '--leverui-marquee-loop-count': 'infinite',
    '--leverui-marquee-edge-color': 'var(--leverui-colors-bg)',
    '--leverui-marquee-edge-size': '20%',
  }}
>
  {/* ... */}
</Marquee.Root>
VariableDescriptionDefault
--leverui-marquee-durationHow long the animation takesComputed
--leverui-marquee-delayHow long to wait before the animation starts0s
--leverui-marquee-loop-countHow many times the animation runsinfinite
--leverui-marquee-edge-colorThe color of the fade at the edgesvar(--leverui-colors-bg)
--leverui-marquee-edge-sizeThe size of the fade at the edges20%

Props

PropDefaultTypeDescription
sidestartSideSide the marquee scrolls towards.
spacing1remstringSpace between items.
speed50numberSpeed, in pixels per second.
asdivNative tagHTML tag to render.
asChild—Solid render functionRender your own element with the marquee's props.
unstyled—booleanTurn off the Lever UI styles.
autoFillfalsebooleanRepeat the content until it fills the container.
defaultPausedfalsebooleanStart paused.
delay0numberWait before the animation starts, in seconds.
ids—Partial<{ root: string; viewport: string; content: (index: number) => string }>Ids for the marquee's elements. For use with other components.
loopCount0numberNumber of loops. 0 loops forever.
onComplete—() => voidCalled when all loops finish. Only when loopCount is above 0.
onLoopComplete—() => voidCalled after each loop.
onPauseChange—(details: PauseStatusDetails) => voidCalled on pause or resume.
paused—booleanWhether the marquee is paused.
pauseOnInteractionfalsebooleanPause on hover or focus.
reversefalsebooleanReverse the animation direction.
translations—IntlTranslationsTranslated messages.

translations.root sets the accessible name of the moving region. Do not put important information only in moving content, and respect reduced motion settings. Edge fades must not hide item text that assistive technology needs.

Customize with CSS

Each part has a stable .leverui-marquee__* class. class and style work on the root, viewport, content, item, and edge. unstyled on the root or a part turns off its default styles. Behavior stays the same.

Code
<Marquee.Root class="featured-marquee" spacing="24px">
  {/* Marquee parts */}
</Marquee.Root>
Code
.featured-marquee {
  --leverui-marquee-edge-size: 12%;
  --leverui-marquee-edge-color: var(--page-background);
  --leverui-marquee-duration: 30s;
}

.featured-marquee .leverui-marquee__item {
  padding-inline: 1rem;
}

The root also has --leverui-marquee-spacing. The measurement variables the marquee sets inline are internal.