Carousel

Slide carousel with prev/next, dots, and optional autoplay. Autoplay holds while the pointer is over it, while focus is inside it, and while a drag is in flight — hovering is not a way to stop moving content for someone who never uses a mouse, which is what WCAG 2.2.2 asks for.

Installation

import { WrCarousel, WrCarouselSlide } from 'ngwr/carousel';

@Component({ imports: [WrCarousel, WrCarouselSlide] })
export class MyComponent {}

Basic

<wr-carousel [(active)]="i" autoplay>
  <wr-carousel-slide>Slide 1</wr-carousel-slide>
  <wr-carousel-slide>Slide 2</wr-carousel-slide>
</wr-carousel>

API

NameDescriptionTypeDefault
prevLabelAccessible name of the previous-slide button. Falls back to carousel.prev.string | nullnull
nextLabelAccessible name of the next-slide button. Falls back to carousel.next.string | nullnull
paginationLabelAccessible name of the dot group. Falls back to carousel.pagination.string | nullnull
ariaLabelAccessible name of the carousel itself. Falls back to carousel.label.string | nullnull
roledescriptionWord a screen reader speaks IN PLACE OF the group role. Falls back to carousel.roledescription, then 'carousel'.string | nullnull
activeActive slide index. Two-way bindable.number0
showArrowsShow prev / next arrow buttons.booleantrue
showDotsShow dot indicators below the slides.booleantrue
autoplayAuto-advance slides.booleanfalse
intervalMsAutoplay interval (ms).number4000
loopWrap around at the ends.booleantrue