Carousel

bs-carousel is generated from the headless carousel core: each slide is a bs-carousel-item, with optional indicators, auto-advance, slide/fade animation in both orientations, touch swipe, keyboard + reduced-motion support, and a radio-driven no-JS tier (server-rendered pages keep navigating with JavaScript disabled).

Basic usage

Demo

Carousel mode
Orientation

Features

  • Touch-event support
  • <noscript> support (interactive: indicators, prev/next with wrap-around, radiogroup arrow keys)
  • Full APG carousel ARIA pattern
  
    
      
        <bs-carousel [indicators]="true" [interval]="4000" aria-label="Animal photos">
        
    
      
          <bs-carousel-item><img src="/assets/resized/deer.png" alt="A deer"></bs-carousel-item>
        
    
      
          <bs-carousel-item><img src="/assets/resized/duck.png" alt="A duck"></bs-carousel-item>
        
    
      
          <bs-carousel-item><img src="/assets/resized/lion.png" alt="A lion"></bs-carousel-item>
        
    
      
        </bs-carousel>
        
    
  
    
      
        import { Component } from '@angular/core';
        
    
      
        import { BsCarouselComponent, BsCarouselItemComponent } from '@mintplayer/ng-bootstrap/carousel';
        
    
      
        
        
    
      
        @Component({
        
    
      
          selector: 'my-carousel-demo',
        
    
      
          templateUrl: './my-carousel-demo.component.html',
        
    
      
          imports: [BsCarouselComponent, BsCarouselItemComponent],
        
    
      
        })
        
    
      
        export class MyCarouselDemoComponent {}
        
    

Without JavaScript (server-rendered)

Two independent carousels: with JS disabled each keeps its own radio-driven state (indicators + prev/next + keyboard), proving instances don't collide.

Nested carousels

A horizontal carousel as a slide of a vertical one: the inner claims horizontal swipes, vertical swipes bubble to the outer, and each viewport keeps its own arrow keys.

  
    
      
        <bs-carousel orientation="vertical" [indicators]="true" aria-label="Outer vertical">
        
    
      
          <bs-carousel-item><img src="/assets/resized/deer.png" alt="A deer"></bs-carousel-item>
        
    
      
          <bs-carousel-item>
        
    
      
            <bs-carousel animation="slide" [indicators]="true" aria-label="Inner horizontal">
        
    
      
              <bs-carousel-item><img src="/assets/resized/duck.png" alt="A duck"></bs-carousel-item>
        
    
      
              <bs-carousel-item><img src="/assets/resized/leopard.png" alt="A leopard"></bs-carousel-item>
        
    
      
            </bs-carousel>
        
    
      
          </bs-carousel-item>
        
    
      
          <bs-carousel-item><img src="/assets/resized/lion.png" alt="A lion"></bs-carousel-item>
        
    
      
        </bs-carousel>