Tailwind CSS Carousel
The Carousel Component provides a smooth and interactive way to cycle through content, whether it be images or text, mimicking the captivating motion of a traditional carousel.
Requires JS
Note that this component requires the use of our Carousel plugin, else you can skip this message if you are already using Preline UI as a package.
Pagination
Add pagination dots so users can see the current slide and jump between slides.
Infinite loop
Use "isInfiniteLoop": true to keep the carousel looping from the last slide back to the first.
Draggable
Use "isDraggable": true to drag slides with the pointer. This does not work when isSnap is enabled.
Created with Preline MCP New
Combine centered slides, draggable interaction, infinite looping, and custom pagination to showcase multiple UI screens.
Snap scrolling
Use "isSnap": true with snap-x snap-mandatory on hs-carousel and snap-center on each hs-carousel-slide to snap slides into place.
Slide counter
Add hs-carousel-info with hs-carousel-info-current and hs-carousel-info-total to display the current slide and total count.
Thumbnails (horizontal)
Use horizontal thumbnails below the carousel as alternate slide controls.
Thumbnails (vertical)
Use a vertical thumbnail rail when the layout has room for side-by-side navigation.
Destroy and reinitialize
Use the destroy method to remove a carousel instance and initialize it again when needed.