Infinite Slider

Infinite scrolling slider component that smoothly loops through its children. It supports both horizontal and vertical directions, with customizable speed and speed on hover. Ideal for creating continuous carousels, marquee displays, or dynamic content showcases.

Example

Infinite Slider basic

Halden
Quillstone
Tidewell
Ashgrove
Brightmoor
Fernhill
Halden
Quillstone
Tidewell
Ashgrove
Brightmoor
Fernhill

Infinite Slider hover speed

Deep focus42 tracks
Morning run28 tracks
Rainy commute35 tracks
Sunday kitchen19 tracks
Late night drive31 tracks
Study hall54 tracks
Deep focus42 tracks
Morning run28 tracks
Rainy commute35 tracks
Sunday kitchen19 tracks
Late night drive31 tracks
Study hall54 tracks

Infinite Slider vertical

Deep focus42 tracks
Morning run28 tracks
Rainy commute35 tracks
Sunday kitchen19 tracks
Late night drive31 tracks
Study hall54 tracks
Deep focus42 tracks
Morning run28 tracks
Rainy commute35 tracks
Sunday kitchen19 tracks
Late night drive31 tracks
Study hall54 tracks
Garden hours23 tracks
Long flight61 tracks
Coffee shop37 tracks
Warm up16 tracks
Wind down26 tracks
Road trip48 tracks
Garden hours23 tracks
Long flight61 tracks
Coffee shop37 tracks
Warm up16 tracks
Wind down26 tracks
Road trip48 tracks

Installation

npx shadcn@latest add https://ui.ndekocode.dev/r/motion-infinite-slider.json

Component API

InfiniteSlider

PropTypeDefaultDescription
childrenReact.ReactNodeThe child elements to be displayed in the slider.
gapnumber16The gap between child elements in pixels.
speednumber100The speed of the slider animation in pixels per second.
speedOnHovernumberThe speed of the slider animation when hovered, in pixels per second.
direction'horizontal' | 'vertical''horizontal'The direction of the slider movement.
reversebooleanfalseWhether to reverse the direction of the slider movement.
classNamestringundefinedOptional CSS class for styling the component.