--- title: Carousel summary: A carousel shows several images or slides in the space of one, with arrows, indicators and captions. description: Display multiple images or slides in a compact carousel with indicators, captions, and automatic or manual navigation. related: [/ui/plugins/inline-player] source: core/scss/ui/_carousel.scss sass-vars: carousel classnames: component: - class: carousel desc: Container element part: - class: carousel-inner desc: Wrapper around the slides - class: carousel-item desc: One slide - class: carousel-caption desc: Text block over a slide - class: carousel-indicators desc: Row of buttons that jump to a slide - class: carousel-control-prev desc: Previous control; use a button so it can take focus - class: carousel-control-next desc: Next control style: - class: carousel-caption-background desc: Adds a scrim behind the caption - class: carousel-indicators-dot desc: Round dot indicators - class: carousel-indicators-thumb desc: Thumbnail indicators - class: carousel-indicators-vertical desc: Stacks the indicators down the side behavior: - class: carousel-fade desc: Crossfades between slides instead of sliding --- import Example from '@components/Example.astro'; ## Default markup The default carousel slides on its own and has an arrow on each side for going to the previous or the next slide. ## Dots indicators You can replace the standard indicators with dots. Just add the `carousel-indicators-dot` class to your carousel: ## Thumb indicators Thumbnails work the same way. Add the `carousel-indicators-thumb` class and set a `background-image` on each `[data-bs-target]` element. Thumbnails are square by default; change that with the `ratio` utilities. ## Vertical indicators Add the `carousel-indicators-vertical` class to stack the indicators on the right side. It combines with the dot and thumbnail classes. Thumbnails on the right side: ## Carousel with captions Put a `.carousel-caption` element inside a `.carousel-item` to add a caption. Add `carousel-caption-background` to lay a dark overlay over the image, so light text stays readable. The captions in this example have the `d-none` class, so they are hidden below the `md` breakpoint. ## Accessibility - Use `button` for the previous and next controls. An `a` without `href` cannot take focus, so the carousel becomes mouse-only. - Give every indicator an `aria-label` such as `Slide 3`, and mark the current one with `aria-current="true"`. Without a label a screen reader announces only "button". - A carousel that plays on its own moves content out from under the reader. Set `data-bs-ride="false"` or give users a pause control. Bootstrap already pauses on hover and on focus. - Keep the slide images meaningful in `alt` text, or leave `alt=""` when the caption already says the same thing. - Bootstrap does not move focus when a slide changes, so anything focusable inside a hidden slide is still reachable by keyboard. Keep interactive content out of carousel slides.