Marquee Component

The Marquee component is a versatile UI element that creates a scrolling marquee effect. It is highly customizable and can adapt to various use cases, such as displaying text or other content in a continuous loop.

Features

  • Customizable Speed: Adjust the scrolling speed dynamically.
  • Responsive Design: Automatically adapts to the container's dimensions.
  • Interactive: Supports hover and scroll-based interactions.
  • Smooth Animations: Uses spring-based animations for fluid transitions.
  • Lightweight: Optimized for performance with minimal dependencies.

Playground

Toggle direction, hover-pause, and scroll reactivity.

Controls
Duration (s) — higher is slower10
Reverse direction
Pause on hover
React to scroll

Installation

Usage

Props

PropertyTypeDefaultDescription
childrenReact.ReactNoderequiredThe content to be rendered inside the marquee.
classNamestringAdditional class names for custom styling of the marquee items.
containerClassNamestringAdditional class names for custom styling of the marquee container.
durationnumber10The duration of the marquee animation in seconds.
reversebooleanfalseDetermines whether the marquee scrolls in reverse direction.
activeScrollbooleanfalseEnables dynamic speed adjustment based on scroll velocity.
activeHoverbooleanfalsePauses the marquee animation when hovered.