Marquee
TheMarquee 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:
linearfor constant speed - Iteration:
infinitefor 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
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
gapvalues to prevent crowding
Speed Configuration
Accessibility
Use Cases
- Logo showcases
- Partner/sponsor displays
- Testimonial carousels
- News tickers
- Social media feeds
- Product highlights
- Award badges
- Technology stack displays