- Lightweight - 1kb minzipped and can be smaller when using bundlers
- Reliable animations
- Typescript definitions
CSS Snap Points makes creating carousels simpler and is much more reliable. This library itself does not do much except for add some commonly used carousel features on top of CSS Snap Points.
Every carousel library I've come across implements their own easing and panning, which is hard to get working well. Its very easy to get it in a state where the animations start to break.
All of the major browser implementations of CSS Snap Points do a much better job IMO.
Anything that isn't core carousel functionality is implemented as a "plugin" so if you're using a module bundler and you're not using all the plugins, you'll get a smaller bundle size.
================================
===============================
Shows a dot for every item in the carousel.
// script tag global
new Carousel.Carousel({
plugins: [
Carousel.SlideshowPlugin({
intervalMs: 5000, // slide every 5000 ms
stopAfterAction: true // stop the slideshow if user changes the slide
})
]
});
// es modules
import { Carousel, SlideshowPlugin } from "carousel";
new Carousel({
plugins: [
SlideshowPlugin({ intervalMs: 5000 })
]
});
Automatically changes the carousel
Example Slide every 5 seconds
import { Carousel, SlideshowPlugin } from "carousel";
new Carousel({ plugins: [SlideshowPlugin({ intervalMs: 5000 })] });