LogoLoop
LogoLoop is a performant, infinite scrolling carousel component designed for displaying logos or icons. It features smooth animations, customizable scrolling directions, hover interactions, and accessibility support.Overview
This component creates a seamless infinite loop effect by automatically duplicating content. It supports horizontal and vertical scrolling, respects reduced motion preferences, and includes features like fade-out edges and hover effects.Props
Array of logo objects to display. Each logo can be an image object with
src, alt, etc., or a node object with custom JSX.Scroll speed in pixels per second. Positive values scroll in the default direction, negative values reverse it.
Direction of the scrolling animation.
Width of the carousel container. Accepts CSS length values or numbers (interpreted as pixels).
Height of each logo in pixels. Width is automatically calculated to maintain aspect ratio.
Spacing between logos in pixels.
If
true, pauses animation on hover. If false, continues at normal speed. If undefined, hover behavior is disabled.Custom speed when hovering. Overrides
pauseOnHover if provided.Enables fade-out gradient at the edges of the carousel for a smoother visual effect.
Custom color for the fade-out gradient. Defaults to white in light mode, dark in dark mode.
Enables scale animation on individual logo hover (1.2x zoom).
Custom render function for each logo item. Provides full control over item rendering.
ARIA label for the carousel region for accessibility.
Additional CSS classes to apply to the root container.
Inline styles to apply to the root container.
Usage
Real-World Example
From the About Me section of Psi Lime Portfolio:Advanced Features
Custom Rendering
Use therenderItem prop for complete control over item rendering:
Custom Node Content
Pass React nodes instead of images:Responsive Sizing
Performance
LogoLoop is highly optimized for performance with several key features:
- RAF-based Animation: Uses
requestAnimationFramefor 60fps smooth scrolling - Dynamic Copy Management: Automatically calculates the minimum number of copies needed
- ResizeObserver: Efficiently handles container size changes
- Image Loading: Waits for images to load before calculating dimensions
- Smooth Easing: Exponential easing for velocity changes (tau = 0.25s)
- Reduced Motion Support: Respects
prefers-reduced-motionmedia query
Accessibility
- Proper ARIA roles (
region,list,listitem) - Customizable ARIA labels
aria-hiddenon duplicate copies- Keyboard accessible links
- Focus-visible outline styles
- Screen reader friendly
Animation Details
Direction Mapping
left: Scrolls content from right to leftright: Scrolls content from left to rightup: Scrolls content from bottom to topdown: Scrolls content from top to bottom
Speed Control
Styling
The component uses CSS custom properties for easy theming:Browser Compatibility
- Modern browsers with ResizeObserver support
- Fallback to window resize events for older browsers
- CSS custom properties support required
- Transform3d for hardware acceleration