/syncfusion-angular:syncfusion-angular-carouselfrom Syncfusion Angular UI Components
Learn how to implement the Syncfusion Angular Carousel component for displaying slides with images and content. This comprehensive skill includes complete API documentation with all 30 properties, 5 methods, 2 events, and working code examples. Use when creating image galleries, product showcases, featured content sliders, news rotators, or implementing carousel navigation with animations.
Ships in Syncfusion Angular UI Components. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use the Syncfusion Angular Carousel component when you need to:
The Syncfusion Angular Carousel component allows users to display images with content, links, and other media in a slide show format. It provides:
Basic carousel with automatic slide transitions:
import { Component } from "@angular/core";
import { CarouselModule } from "@syncfusion/ej2-angular-navigations";
@Component({
selector: "app-carousel",
standalone: true,
imports: [CarouselModule],
template: `
<div class="carousel-container">
<ejs-carousel [autoPlay]="true" [animationEffect]="'Slide'">
<e-carousel-items>
<e-carousel-item>
<ng-template #template>
<figure class="img-container">
<img src="https://ej2.syncfusion.com/products/images/carousel/cardinal.png" alt="Slide 1" />
<figcaption>Cardinal</figcaption>
</figure>
</ng-template>
</e-carousel-item>
<e-carousel-item>
<ng-template #template>
<figure class="img-container">
<img src="https://ej2.syncfusion.com/products/images/carousel/hunei.png" alt="Slide 2" />
<figcaption>Kingfisher</figcaption>
</figure>
</ng-template>
</e-carousel-item>
<e-carousel-item>
<ng-template #template>
<figure class="img-container">
<img src="https://ej2.syncfusion.com/products/images/carousel/costa-rica.png" alt="Slide 3" />
<figcaption>Keel-billed Toucan</figcaption>
</figure>
</ng-template>
</e-carousel-item>
</e-carousel-items>
</ejs-carousel>
</div>
`,
styles: [`
.carousel-container {
height: 400px;
margin: 20px 0;
}
`]
})
export class CarouselComponent {}
Key result: Carousel automatically transitions between slides every 5000ms with slide animation.
animationEffect
'None' | 'Slide' | 'Fade' | 'Custom''Slide'// Fade animation
<ejs-carousel [animationEffect]="'Fade'">
<!-- Smooth fade in/out between slides -->
</ejs-carousel>
// No animation
<ejs-carousel [animationEffect]="'None'">
<!-- Instant slide transition -->
</ejs-carousel>
// Custom CSS animation
<ejs-carousel [animationEffect]="'Custom'" [cssClass]="'custom-animation'">
<!-- Define custom animation in CSS -->
</ejs-carousel>
autoPlay
booleantrue<ejs-carousel [autoPlay]="true" [interval]="3000">
<!-- Auto transitions every 3 seconds -->
</ejs-carousel>
interval
number5000 (milliseconds)<ejs-carousel [autoPlay]="true" [interval]="2000">
<!-- 2 second interval between slides -->
</ejs-carousel>
pauseOnHover
booleantrue<ejs-carousel [autoPlay]="true" [pauseOnHover]="false">
<!-- Continue auto-play even on hover -->
</ejs-carousel>
buttonsVisibility
'Visible' | 'Hidden' | 'VisibleOnHover''Visible'// Always visible
<ejs-carousel [buttonsVisibility]="'Visible'">
<!-- Buttons always shown -->
</ejs-carousel>
// Only on hover
<ejs-carousel [buttonsVisibility]="'VisibleOnHover'">
<!-- Buttons appear on mouse hover -->
</ejs-carousel>
// Never visible
<ejs-carousel [buttonsVisibility]="'Hidden'">
<!-- Use indicators or swipe instead -->
</ejs-carousel>
previousButtonTemplate
string | objectnull<ejs-carousel [previousButtonTemplate]="'#prevBtnTemplate'">
<ng-template #prevBtnTemplate>
<button class="custom-prev"><i class="icon-left"></i> Back</button>
</ng-template>
<e-carousel-items><!-- Items --></e-carousel-items>
</ejs-carousel>
nextButtonTemplate
string | objectnull<ejs-carousel [nextButtonTemplate]="'#nextBtnTemplate'">
<ng-template #nextBtnTemplate>
<button class="custom-next">Next <i class="icon-right"></i></button>
</ng-template>
<e-carousel-items><!-- Items --></e-carousel-items>
</ejs-carousel>
loop
booleantrue<ejs-carousel [loop]="true">
<!-- Last slide -> First slide -->
</ejs-carousel>
<ejs-carousel [loop]="false">
<!-- Last slide -> Navigation stops -->
</ejs-carousel>
selectedIndex
number0<ejs-carousel [selectedIndex]="2">
<!-- Start on third slide (index 2) -->
</ejs-carousel>
showIndicators
booleantrue<ejs-carousel [showIndicators]="true">
<!-- Indicators visible -->
</ejs-carousel>
<ejs-carousel [showIndicators]="false">
<!-- No indicators shown -->
</ejs-carousel>
indicatorsType
'Default' | 'Dynamic' | 'Fraction' | 'Progress''Default'// Dot indicators
<ejs-carousel [indicatorsType]="'Default'">
<!-- Shows: ● ● ● ● ● -->
</ejs-carousel>
// Numeric format
<ejs-carousel [indicatorsType]="'Fraction'">
<!-- Shows: 1 / 5 -->
</ejs-carousel>
// Progress bar
<ejs-carousel [indicatorsType]="'Progress'">
<!-- Visual progress bar -->
</ejs-carousel>
// Animated
<ejs-carousel [indicatorsType]="'Dynamic'">
<!-- Animated indicator effect -->
</ejs-carousel>
indicatorsTemplate
string | objectnull<ejs-carousel [indicatorsTemplate]="'#indicatorTemplate'" [showIndicators]="true">
<ng-template #indicatorTemplate let-data let-index="index">
<img [src]="items[index]?.thumbnail" class="thumb" />
</ng-template>
<e-carousel-items><!-- Items --></e-carousel-items>
</ejs-carousel>
showPlayButton
booleantrue<ejs-carousel [autoPlay]="false" [showPlayButton]="true">
<!-- Users can click play to resume auto-play -->
</ejs-carousel>
<ejs-carousel [showPlayButton]="false">
<!-- No play button visible -->
</ejs-carousel>
playButtonTemplate
string | objectnull<ejs-carousel [playButtonTemplate]="'#playBtnTemplate'">
<ng-template #playBtnTemplate>
<button class="play-btn">▶ Resume</button>
</ng-template>
<e-carousel-items><!-- Items --></e-carousel-items>
</ejs-carousel>
dataSource
any[]null// Component
export class CarouselComponent {
public slides = [
{ id: 1, image: 'img1.jpg', title: 'Slide 1' },
{ id: 2, image: 'img2.jpg', title: 'Slide 2' },
{ id: 3, image: 'img3.jpg', title: 'Slide 3' }
];
}
// Template
<ejs-carousel [dataSource]="slides">
<ng-template #itemTemplate let-item>
<figure>
<img [src]="item.image" [alt]="item.title" />
<figcaption>{{item.title}}</figcaption>
</figure>
</ng-template>
</ejs-carousel>
itemTemplate
string | objectnull<ejs-carousel [dataSource]="products">
<ng-template #itemTemplate let-product>
<div class="product-card">
<img [src]="product.image" />
<h3>{{product.name}}</h3>
<p>${{product.price}}</p>
</div>
</ng-template>
</ejs-carousel>
items
CarouselItem[][]<ejs-carousel>
<e-carousel-items>
<e-carousel-item>
<ng-template #template><img src="image1.jpg" /></ng-template>
</e-carousel-item>
<e-carousel-item>
<ng-template #template><img src="image2.jpg" /></ng-template>
</e-carousel-item>
</e-carousel-items>
</ejs-carousel>
cssClass
string''<ejs-carousel [cssClass]="'dark-theme full-width'">
<!-- Apply custom styles via CSS classes -->
</ejs-carousel>
enableTouchSwipe
booleantrue<ejs-carousel [enableTouchSwipe]="true">
<!-- Touch swipe enabled -->
</ejs-carousel>
<ejs-carousel [enableTouchSwipe]="false">
<!-- Touch swipe disabled -->
</ejs-carousel>
swipeMode
'Touch' | 'Mouse' | 'Touch|Mouse''Touch|Mouse'// Both touch and mouse
<ejs-carousel [swipeMode]="'Touch|Mouse'" [enableTouchSwipe]="true">
<!-- Both interactions work -->
</ejs-carousel>
// Touch only
<ejs-carousel [swipeMode]="'Touch'" [enableTouchSwipe]="true">
<!-- Only touch gestures work -->
</ejs-carousel>
// Mouse only
<ejs-carousel [swipeMode]="'Mouse'" [enableTouchSwipe]="true">
<!-- Only mouse drag works -->
</ejs-carousel>
allowKeyboardInteraction
booleantrue<ejs-carousel [allowKeyboardInteraction]="true">
<!-- Arrow keys navigate slides -->
</ejs-carousel>
<ejs-carousel [allowKeyboardInteraction]="false">
<!-- Arrow keys disabled -->
</ejs-carousel>
height
string | number'100%'// Fixed height
<ejs-carousel [height]="400">
<!-- 400px height -->
</ejs-carousel>
// Percentage
<ejs-carousel [height]="'100%'">
<!-- Full parent height -->
</ejs-carousel>
width
string | number'100%'// Fixed width
<ejs-carousel [width]="800">
<!-- 800px width -->
</ejs-carousel>
// Full width
<ejs-carousel [width]="'100%'">
<!-- Full parent width -->
</ejs-carousel>
partialVisible
booleanfalse<ejs-carousel [partialVisible]="true">
<!-- Shows portion of adjacent slides -->
</ejs-carousel>
<ejs-carousel [partialVisible]="false">
<!-- Only current slide fully visible -->
</ejs-carousel>
locale
string'' (uses browser locale)<ejs-carousel [locale]="'de-DE'">
<!-- German localization -->
</ejs-carousel>
<ejs-carousel [locale]="'fr-FR'">
<!-- French localization -->
</ejs-carousel>
enablePersistence
booleanfalse<ejs-carousel [enablePersistence]="true">
<!-- Current slide position saved and restored -->
</ejs-carousel>
enableRtl
booleanfalse<ejs-carousel [enableRtl]="true">
<!-- RTL layout for Arabic, Hebrew, etc. -->
</ejs-carousel>
htmlAttributes
Record<string, any>null<ejs-carousel [htmlAttributes]="{ 'data-type': 'hero', 'aria-label': 'Hero Carousel' }">
<!-- Custom attributes applied -->
</ejs-carousel>
next(): voidimport { Component, ViewChild } from "@angular/core";
import { CarouselComponent } from "@syncfusion/ej2-angular-navigations";
@Component({
selector: "app-carousel-nav",
template: `
<button (click)="goNext()">Next</button>
<ejs-carousel #carousel>
<e-carousel-items>
<e-carousel-item><ng-template #template><img src="img1.jpg" /></ng-template></e-carousel-item>
<e-carousel-item><ng-template #template><img src="img2.jpg" /></ng-template></e-carousel-item>
</e-carousel-items>
</ejs-carousel>
`
})
export class CarouselNavComponent {
@ViewChild("carousel") carousel!: CarouselComponent;
goNext() {
this.carousel.next();
}
}
prev(): voidexport class CarouselNavComponent {
@ViewChild("carousel") carousel!: CarouselComponent;
goPrev() {
this.carousel.prev();
}
}
play(): voidimport { Component, ViewChild } from "@angular/core";
import { CarouselComponent } from "@syncfusion/ej2-angular-navigations";
@Component({
selector: "app-carousel-controls",
template: `
<button (click)="playSlides()">Play</button>
<button (click)="pauseSlides()">Pause</button>
<ejs-carousel #carousel [autoPlay]="false">
<e-carousel-items>
<e-carousel-item><ng-template #template><img src="img1.jpg" /></ng-template></e-carousel-item>
<e-carousel-item><ng-template #template><img src="img2.jpg" /></ng-template></e-carousel-item>
</e-carousel-items>
</ejs-carousel>
`
})
export class CarouselControlsComponent {
@ViewChild("carousel") carousel!: CarouselComponent;
playSlides() {
this.carousel.play();
}
pauseSlides() {
this.carousel.pause();
}
}
pause(): voidexport class CarouselControlsComponent {
@ViewChild("carousel") carousel!: CarouselComponent;
pauseSlides() {
this.carousel.pause();
}
}
destroy(): voidimport { Component, ViewChild, OnDestroy } from "@angular/core";
import { CarouselComponent } from "@syncfusion/ej2-angular-navigations";
@Component({
selector: "app-carousel-cleanup",
template: `
<ejs-carousel #carousel>
<e-carousel-items>
<e-carousel-item><ng-template #template><img src="img1.jpg" /></ng-template></e-carousel-item>
</e-carousel-items>
</ejs-carousel>
`
})
export class CarouselCleanupComponent implements OnDestroy {
@ViewChild("carousel") carousel!: CarouselComponent;
ngOnDestroy() {
// Cleanup when component destroyed
this.carousel.destroy();
}
}
SlideChangingEventArgsEvent Arguments:
cancel: boolean – Set true to prevent transitioncurrentIndex: number – Current slide indexcurrentSlide: HTMLElement – Current slide DOM elementnextIndex: number – Next slide index to displaynextSlide: HTMLElement – Next slide DOM elementisSwiped: boolean – Whether triggered by swipeslideDirection: 'Next' | 'Previous' – Direction of changename: string – Event name ('slideChanging')import { Component, ViewChild } from "@angular/core";
import { CarouselComponent, SlideChangingEventArgs } from "@syncfusion/ej2-angular-navigations";
@Component({
selector: "app-carousel-event",
template: `
<div class="status">Cannot navigate to slide 2</div>
<ejs-carousel #carousel (slideChanging)="onSlideChanging($event)">
<e-carousel-items>
<e-carousel-item><ng-template #template><img src="img1.jpg" /><p>Slide 1</p></ng-template></e-carousel-item>
<e-carousel-item><ng-template #template><img src="img2.jpg" /><p>Slide 2 - BLOCKED</p></ng-template></e-carousel-item>
<e-carousel-item><ng-template #template><img src="img3.jpg" /><p>Slide 3</p></ng-template></e-carousel-item>
</e-carousel-items>
</ejs-carousel>
`
})
export class CarouselEventComponent {
onSlideChanging(args: SlideChangingEventArgs) {
console.log(`Transitioning from ${args.currentIndex} to ${args.nextIndex}`);
// Prevent navigating to slide 2
if (args.nextIndex === 1) {
args.cancel = true;
alert("Slide 2 is blocked");
}
}
}
SlideChangedEventArgsEvent Arguments:
currentIndex: number – Current slide indexcurrentSlide: HTMLElement – Current slide DOM elementpreviousIndex: number – Previous slide indexpreviousSlide: HTMLElement – Previous slide DOM elementisSwiped: boolean – Whether triggered by swipeslideDirection: 'Next' | 'Previous' – Direction of changename: string – Event name ('slideChanged')import { Component, ViewChild } from "@angular/core";
import { CarouselComponent, SlideChangedEventArgs } from "@syncfusion/ej2-angular-navigations";
@Component({
selector: "app-carousel-tracking",
template: `
<div class="slide-counter">Slide {{currentSlide}} of {{totalSlides}}</div>
<ejs-carousel #carousel (slideChanged)="onSlideChanged($event)">
<e-carousel-items>
<e-carousel-item><ng-template #template><img src="img1.jpg" /></ng-template></e-carousel-item>
<e-carousel-item><ng-template #template><img src="img2.jpg" /></ng-template></e-carousel-item>
<e-carousel-item><ng-template #template><img src="img3.jpg" /></ng-template></e-carousel-item>
</e-carousel-items>
</ejs-carousel>
`
})
export class CarouselTrackingComponent {
currentSlide = 1;
totalSlides = 3;
onSlideChanged(args: SlideChangedEventArgs) {
this.currentSlide = args.currentIndex + 1;
console.log(`Now on slide ${args.currentIndex}`);
console.log(`Direction: ${args.slideDirection}`);
console.log(`Swiped: ${args.isSwiped}`);
}
}
Complete table of default values for all 30 properties:
| Property | Default | Type |
|---|---|---|
| allowKeyboardInteraction | true | boolean |
| animationEffect | 'Slide' | string |
| autoPlay | true | boolean |
| buttonsVisibility | 'Visible' | string |
| cssClass | '' | string |
| dataSource | null | any[] |
| enablePersistence | false | boolean |
| enableRtl | false | boolean |
| enableTouchSwipe | true | boolean |
| height | '100%' | string/number |
| htmlAttributes | null | Record |
| indicatorsTemplate | null | string/object |
| indicatorsType | 'Default' | string |
| interval | 5000 | number (ms) |
| itemTemplate | null | string/object |
| items | [] | CarouselItem[] |
| locale | '' | string |
| loop | true | boolean |
| nextButtonTemplate | null | string/object |
| partialVisible | false | boolean |
| pauseOnHover | true | boolean |
| playButtonTemplate | null | string/object |
| previousButtonTemplate | null | string/object |
| selectedIndex | 0 | number |
| showIndicators | true | boolean |
| showPlayButton | true | boolean |
| swipeMode | 'Touch|Mouse' | string |
| width | '100%' | string/number |
When to use: Loading carousel items from an API or dynamic data source.
import { Component, OnInit } from "@angular/core";
import { HttpClient } from "@angular/common/http";
@Component({
selector: "app-data-carousel",
template: `
<ejs-carousel [dataSource]="items" [selectedIndex]="0">
<ng-template #itemTemplate let-item>
<figure class="img-container">
<img [src]="item.image" [alt]="item.title" />
<figcaption>{{item.title}}</figcaption>
</figure>
</ng-template>
</ejs-carousel>
`
})
export class DataCarouselComponent implements OnInit {
items: any[] = [];
constructor(private http: HttpClient) {}
ngOnInit() {
this.http.get<any>('/api/carousel-items')
.subscribe(data => this.items = data);
}
}
When to use: Users control slide transitions with custom buttons instead of auto-play.
import { Component, ViewChild } from "@angular/core";
import { CarouselComponent } from "@syncfusion/ej2-angular-navigations";
@Component({
selector: "app-manual-nav",
template: `
<div class="carousel-controls">
<button (click)="prevSlide()" class="control-btn">← Previous</button>
<span class="slide-counter">{{currentSlide}} / {{totalSlides}}</span>
<button (click)="nextSlide()" class="control-btn">Next →</button>
</div>
<ejs-carousel
#carousel
[autoPlay]="false"
[buttonsVisibility]="'Hidden'"
(slideChanged)="onSlideChanged($event)"
>
<e-carousel-items>
<e-carousel-item *ngFor="let item of items">
<ng-template #template>
<img [src]="item.image" />
</ng-template>
</e-carousel-item>
</e-carousel-items>
</ejs-carousel>
`
})
export class ManualNavCarouselComponent {
@ViewChild("carousel") carousel!: CarouselComponent;
items = [
{ image: 'image1.jpg' },
{ image: 'image2.jpg' },
{ image: 'image3.jpg' }
];
currentSlide = 1;
totalSlides = this.items.length;
prevSlide() { this.carousel.prev(); }
nextSlide() { this.carousel.next(); }
onSlideChanged(event: any) {
this.currentSlide = event.currentIndex + 1;
}
}
When to use: Execute custom logic on slide transitions, track analytics, or prevent certain actions.
import { Component, ViewChild } from "@angular/core";
import { CarouselComponent, SlideChangingEventArgs, SlideChangedEventArgs } from "@syncfusion/ej2-angular-navigations";
@Component({
selector: "app-event-carousel",
template: `
<div class="carousel-stats">
<p>Total Views: {{viewCount}}</p>
<p>Current: {{lastViewedSlide}}</p>
</div>
<ejs-carousel
#carousel
(slideChanging)="onSlideChanging($event)"
(slideChanged)="onSlideChanged($event)"
>
<e-carousel-items>
<e-carousel-item *ngFor="let item of slides">
<ng-template #template>
<img [src]="item.image" />
<h3>{{item.title}}</h3>
</ng-template>
</e-carousel-item>
</e-carousel-items>
</ejs-carousel>
`
})
export class EventCarouselComponent {
@ViewChild("carousel") carousel!: CarouselComponent;
slides = [
{ title: 'Slide 1', image: 'image1.jpg' },
{ title: 'Slide 2', image: 'image2.jpg' },
{ title: 'Slide 3', image: 'image3.jpg' }
];
viewCount = 0;
lastViewedSlide = '';
onSlideChanging(args: SlideChangingEventArgs) {
// Example: Prevent returning to first slide
if (args.previousIndex === 1 && args.nextIndex === 0) {
console.log("Blocking return to first slide");
// args.cancel = true; // Uncomment to prevent
}
}
onSlideChanged(args: SlideChangedEventArgs) {
this.viewCount++;
this.lastViewedSlide = this.slides[args.currentIndex].title;
// Log analytics
console.log(`Viewed slide ${args.currentIndex} via ${args.slideDirection}`);
}
}
For detailed implementation on specific topics, see:
See reference files for detailed implementation examples and best practices.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-angular65 skills in this plugin
/syncfusion-angular-3d-chartImplement interactive 3D charts in Angular applications using Syncfusion. Guide covers setup, chart types (bar, column, stacked variants), customization, data binding, axis configuration, legends, tooltips, selection, data labels, appearance styling, dimensions, print/export, and accessibility. Use this skill whenever a user needs to create, configure, or customize 3D chart visualizations./syncfusion-angular-accordionGuide for implementing Angular Accordion components for collapsible content panels, expandable sections, FAQs, multi-step wizards, step-by-step forms, navigation menus, or tabbed navigation. Use this skill when users mention expanding/collapsing content, accordion layouts, step-by-step workflows, or hierarchical content organization. This skill covers initialization, expand modes, data binding, dynamic loading, animations, nested accordions, and real-world patterns./syncfusion-angular-accumulation-chartImplement and customize Syncfusion Angular Accumulation Charts (Pie, Doughnut, Pyramid, Funnel) with data binding, labels, legends, and tooltips. Use this when creating accumulation charts, configuring chart types, customizing data visualization, adding annotations, or handling interactive chart events in Angular applications.Other plugins' skills for the same job