Class IgxCarouselComponent

Ignite UI for Angular Carousel - Documentation

The Ignite UI Carousel is used to browse or navigate through a collection of slides. Slides can contain custom content such as images or cards and be used for things such as on-boarding tutorials or page-based interfaces. It can be used as a separate fullscreen element or inside another component.

Example:

<igx-carousel>
  <igx-slide>
    <h3>First Slide Header</h3>
    <p>First slide Content</p>
  <igx-slide>
  <igx-slide>
    <h3>Second Slide Header</h3>
    <p>Second Slide Content</p>
</igx-carousel>

Hierarchy

  • IgxCarouselComponentBase
    • IgxCarouselComponent

Implements

  • OnDestroy
  • AfterContentInit

Index

Constructors

constructor

  • new IgxCarouselComponent(element: ElementRef<any>, iterableDiffers: IterableDiffers, builder: AnimationBuilder, platformUtil: PlatformUtil): IgxCarouselComponent

Properties

animationType

animationType: string = ...

Gets/sets the animation type of carousel. Default value is slide.

<igx-carousel animationType='none'>
<igx-carousel>
@memberof

IgxSlideComponent

cssClass

cssClass: string = 'igx-carousel'

Returns the class of the carousel component.

let class =  this.carousel.cssClass;
@memberof

IgxCarouselComponent

gesturesSupport

gesturesSupport: boolean = true

Controls whether the carousel should support gestures. Default value is true.

<igx-carousel [gesturesSupport] = "false"></igx-carousel>
@memberof

IgxCarouselComponent

id

id: string = ...

Sets the id of the carousel. If not set, the id of the first carousel component will be "igx-carousel-0".

<igx-carousel id="my-first-carousel"></igx-carousel>
@memberof

IgxCarouselComponent

indicatorTemplate

indicatorTemplate: TemplateRef<any> = null

The custom template, if any, that should be used when rendering carousel indicators

// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.carousel.indicatorTemplate = myCustomTemplate;
<!-- Set in markup -->
 <igx-carousel #carousel>
     ...
     <ng-template igxCarouselIndicator let-slide>
        <igx-icon *ngIf="slide.active">brightness_7</igx-icon>
        <igx-icon *ngIf="!slide.active">brightness_5</igx-icon>
     </ng-template>
 </igx-carousel>

indicatorsOrientation

indicatorsOrientation: CarouselIndicatorsOrientation = ...

Gets/sets the display mode of carousel indicators. It can be top or bottom. Default value is bottom.

<igx-carousel indicatorsOrientation='top'>
<igx-carousel>
@memberof

IgxSlideComponent

keyboardSupport

keyboardSupport: boolean = true

Controls whether the carousel should support keyboard navigation. Default value is true.

<igx-carousel [keyboardSupport] = "false"></igx-carousel>
@memberof

IgxCarouselComponent

loop

loop: boolean = true

Sets whether the carousel should loop back to the first slide after reaching the last slide. Default value is true.

<igx-carousel [loop]="false"></igx-carousel>
@memberof

IgxCarouselComponent

maximumIndicatorsCount

maximumIndicatorsCount: number = 5

Controls the maximum indexes that can be shown. Default value is 5.

<igx-carousel [maximumIndicatorsCount] = "10"></igx-carousel>
@memberof

IgxCarouselComponent

navigation

navigation: boolean = true

Controls whether the carousel should render the left/right navigation buttons. Default value is true.

<igx-carousel [navigation] = "false"></igx-carousel>
@memberof

IgxCarouselComponent

nextButtonTemplate

nextButtonTemplate: TemplateRef<any> = null

The custom template, if any, that should be used when rendering carousel next button

// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.carousel.nextButtonTemplate = myCustomTemplate;
<!-- Set in markup -->
 <igx-carousel #carousel>
     ...
     <ng-template igxCarouselNextButton let-disabled>
           <button igxButton="fab" igxRipple="white" [disabled]="disabled">
               <igx-icon>add</igx-icon>
          </button>
     </ng-template>
 </igx-carousel>

onCarouselPaused

onCarouselPaused: EventEmitter<IgxCarouselComponent> = ...

An event that is emitted after the carousel has been paused. Provides a reference to the IgxCarouselComponent as an event argument.

<igx-carousel (onCarouselPaused)="onCarouselPaused($event)"></igx-carousel>
@memberof

IgxCarouselComponent

onCarouselPlaying

onCarouselPlaying: EventEmitter<IgxCarouselComponent> = ...

An event that is emitted after the carousel has resumed transitioning between slides. Provides a reference to the IgxCarouselComponent as an event argument.

<igx-carousel (onCarouselPlaying)="onCarouselPlaying($event)"></igx-carousel>
@memberof

IgxCarouselComponent

onSlideAdded

onSlideAdded: EventEmitter<ISlideEventArgs> = ...

An event that is emitted after a slide has been added to the carousel. Provides references to the IgxCarouselComponent and IgxSlideComponent as event arguments.

<igx-carousel (onSlideAdded)="onSlideAdded($event)"></igx-carousel>
@memberof

IgxCarouselComponent

onSlideChanged

onSlideChanged: EventEmitter<ISlideEventArgs> = ...

An event that is emitted after a slide transition has happened. Provides references to the IgxCarouselComponent and IgxSlideComponent as event arguments.

<igx-carousel (onSlideChanged)="onSlideChanged($event)"></igx-carousel>
@memberof

IgxCarouselComponent

onSlideRemoved

onSlideRemoved: EventEmitter<ISlideEventArgs> = ...

An event that is emitted after a slide has been removed from the carousel. Provides references to the IgxCarouselComponent and IgxSlideComponent as event arguments.

<igx-carousel (onSlideRemoved)="onSlideRemoved($event)"></igx-carousel>
@memberof

IgxCarouselComponent

pause

pause: boolean = true

Sets whether the carousel will pause the slide transitions on user interactions. Default value is true.

 <igx-carousel [pause]="false"></igx-carousel>
@memberof

IgxCarouselComponent

prevButtonTemplate

prevButtonTemplate: TemplateRef<any> = null

The custom template, if any, that should be used when rendering carousel previous button

// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.carousel.nextButtonTemplate = myCustomTemplate;
<!-- Set in markup -->
 <igx-carousel #carousel>
     ...
     <ng-template igxCarouselPrevButton let-disabled>
           <button igxButton="fab" igxRipple="white" [disabled]="disabled">
               <igx-icon>remove</igx-icon>
          </button>
     </ng-template>
 </igx-carousel>

role

role: string = 'region'

Returns the role attribute of the carousel.

let carouselRole =  this.carousel.role;
@memberof

IgxCarouselComponent

slides

slides: QueryList<IgxSlideComponent>

The collection of slides currently in the carousel.

let slides: QueryList<IgxSlideComponent> = this.carousel.slides;
@memberof

IgxCarouselComponent

Accessors

current

  • get current(): number

interval

  • get interval(): number
  • set interval(value: number): void

isDestroyed

  • get isDestroyed(): boolean

isPlaying

  • get isPlaying(): boolean

nativeElement

  • get nativeElement(): any

resourceStrings

total

  • get total(): number

touchAction

  • get touchAction(): "auto" | "pan-y"

Methods

add

get

next

  • next(): void

play

  • play(): void

prev

  • prev(): void

remove

select

stop

  • stop(): void