Skip to main content

Marquee

The Marquee component creates an infinite scrolling effect perfect for displaying logos, testimonials, or any content that needs continuous horizontal movement. Features smooth CSS animations with pause-on-hover support.

Installation

Import

Usage

Props

React.ReactNode
required
The content to scroll. Typically a flex container with items.
number
default:"20"
Animation duration in seconds. Lower values = faster scrolling.
number
default:"2"
Number of times to repeat the content. Minimum 2 recommended for seamless loops.
'left' | 'right'
default:"'left'"
Scroll direction.
boolean
default:"true"
Whether to pause animation when hovering.
number
default:"0"
Gap between repeated content instances in pixels.
string
Additional CSS classes for the container.

Animation Details

CSS Keyframes

The component uses pure CSS animations for optimal performance:

Animation Properties

  • Timing: linear for constant speed
  • Iteration: infinite for continuous scrolling
  • Duration: Configurable via props
The repeat prop duplicates the content to ensure seamless infinite scrolling without gaps.

Examples

Partner Logos

Testimonials Scroll

Dual Direction Marquees

News Ticker

For seamless scrolling, ensure your content width is sufficient. Use repeat={2} or higher to avoid visible gaps.

Best Practices

Performance

  • Uses CSS animations (GPU-accelerated)
  • No JavaScript required for animation loop
  • Minimal re-renders

Content Guidelines

  • Keep individual items similar in size for visual consistency
  • Use fixed widths for items when possible
  • Include enough items to fill the viewport width
  • Set appropriate gap values to prevent crowding

Speed Configuration

Accessibility

Continuous motion can be problematic for users with vestibular disorders. Consider:
  • Setting pauseOnHover={true} (default)
  • Providing a pause/play control
  • Respecting prefers-reduced-motion media query

Use Cases

  • Logo showcases
  • Partner/sponsor displays
  • Testimonial carousels
  • News tickers
  • Social media feeds
  • Product highlights
  • Award badges
  • Technology stack displays