The carousel presents a set of slides by sequentially displaying a subset of one or more.
- Slots
-
default— The slides of the carousel. -
indicator— Renders the custom indicators of the carousel. An indicator element sets this slot itself. -
previous-button— Renders content inside the previous button. -
next-button— Renders content inside the next button.
- CSS Parts
-
navigation— The wrapper container of each carousel navigation button. -
previous— The wrapper container of the carousel previous navigation button. -
next— The wrapper container of the carousel next navigation button. -
dot— The carousel dot indicator container. -
active— The carousel active dot indicator container. -
label— The label container of the carousel indicators. -
indicators— The wrapper of the indicators, or of the label that replaces them. -
start— The wrapping container of all carousel indicators when indicators-orientation is set to start. -
indicator— Added to the two state wrappers of each default dot indicator, with `active` or `inactive`. -
inactive— The wrapper of the inactive state of each default dot indicator.
Properties
Section titled "Properties"animationType
Section titled "animationType"The animation type.
animationType: HorizontalTransitionAnimation disableLoop
Section titled "disableLoop"Whether the carousel stops at the first and the last slide instead of looping.
disableLoop: boolean disablePauseOnInteraction
Section titled "disablePauseOnInteraction"Whether the carousel keeps playing when the user hovers over it or moves the focus into it.
disablePauseOnInteraction: boolean hideIndicators
Section titled "hideIndicators"Whether the indicator controls (dots) are hidden.
hideIndicators: boolean hideNavigation
Section titled "hideNavigation"Whether the navigation buttons are hidden.
hideNavigation: boolean indicatorsLabelFormat
Section titled "indicatorsLabelFormat"The format of the aria-label of the carousel indicators.
Each {0} changes to the number of the corresponding slide.
indicatorsLabelFormat: string indicatorsOrientation
Section titled "indicatorsOrientation"The position of the indicator controls (dots).
indicatorsOrientation: CarouselIndicatorsOrientation interval
Section titled "interval"The duration in milliseconds between changing the active slide. A positive value starts the automatic rotation.
interval: number | undefined maximumIndicatorsCount
Section titled "maximumIndicatorsCount"The maximum number of indicator controls (dots) that can be shown. With more slides, a label shows instead of the dots.
maximumIndicatorsCount: number slidesLabelFormat
Section titled "slidesLabelFormat"The format of the aria-label of the carousel slides, and of the label that
shows when the number of slides is greater than maximumIndicatorsCount.
Each {0} changes to the number of the slide, and each {1} to the total number of slides.
slidesLabelFormat: string Accessors
Section titled "Accessors"current
Section titled "current"The index of the current active slide.
get current(): number
Returns number
isPaused
Section titled "isPaused"Whether the carousel is in paused state.
get isPaused(): boolean
Returns boolean
isPlaying
Section titled "isPlaying"Whether the carousel is in playing state.
get isPlaying(): boolean
Returns boolean
slides
Section titled "slides"The slides of the carousel.
get slides(): IgrCarouselSlideComponent[]
Returns IgrCarouselSlideComponent[]
total
Section titled "total"Total number of slides.
get total(): number
Returns number
Methods
Section titled "Methods"Removes focus from the carousel.
blur(): void Returns void
focus
Section titled "focus"Sets focus on the carousel.
focus(options: FocusOptions): void Parameters
- options:
FocusOptions
Returns void
Switches to the next slide, runs any animations, and returns whether the operation was successful.
next(): Promise<boolean> Returns Promise<boolean>
pause
Section titled "pause"Pauses the rotation of the carousel slides.
pause(): void Returns void
Resumes playing of the carousel slides.
play(): void Returns void
Switches to the previous slide, runs any animations, and returns whether the operation was successful.
prev(): Promise<boolean> Returns Promise<boolean>
select
Section titled "select"Switches to the passed-in slide, runs any animations, and returns whether the operation was successful.
select(slide: IgrCarouselSlideComponent, animationDirection: "next" | "prev"): Promise<boolean> Parameters
- slide:
IgrCarouselSlideComponent - animationDirection:
"next" | "prev"
Returns Promise<boolean>
Events
Section titled "Events"onPaused
Section titled "onPaused"Emitted when the carousel enters paused state by a user interaction.
onPaused(args: CustomEvent<void>): void Parameters
- args:
CustomEvent<void>
Returns void
onPlaying
Section titled "onPlaying"Emitted when the carousel enters playing state by a user interaction.
onPlaying(args: CustomEvent<void>): void Parameters
- args:
CustomEvent<void>
Returns void
onSlideChanged
Section titled "onSlideChanged"Emitted when the current active slide is changed either by user interaction or by the interval callback.
onSlideChanged(args: CustomEvent<number>): void Parameters
- args:
CustomEvent<number>