Carousel
Carousel
How it works
The carousel is a slideshow for cycling through a series of content, built with CSS 3D
transforms and a bit of JavaScript. It works with a series of images, text, or custom
markup. It also includes support for previous/next controls and indicators.
In browsers where the Page Visibility API is supported, the carousel will avoid sliding
when the webpage is not visible to the user (such as when the browser tab is
inactive, the browser window is minimized, etc.).
Please be aware that nested carousels are not supported, and carousels are generally
not compliant with accessibility standards.
Example
Carousels don’t automatically normalize slide dimensions. As such, you may need to
use additional utilities or custom styles to appropriately size content. While carousels
support previous/next controls and indicators, they’re not explicitly required. Add
and customize as you see fit.
Slides only
You can also add the indicators to the carousel, alongside the controls, too.
With captions
Usage
Via data attributes
Use data attributes to easily control the position of the carousel. data-slide accepts
the keywords prev or next, which alters the slide position relative to its current
position. Alternatively, use data-slide-to to pass a raw slide index to the
carousel data-slide-to="2", which shifts the slide position to a particular index
beginning with 0.
Via JavaScript