The Carousel
component is a slideshow feature for cycling through content such as images or text slides, displayed like a rotating carousel.
Below are examples of the Carousel
component:
<carousel indicators controls>
<div class="main">
<div class="item">
</div>
<div class="item">
</div>
</div>
</carousel>
Key details for customizing and utilizing the Carousel
component:
--height
- Set the carousel height.--edge-offset
- Define the margin or offset at carousel edges.controls
attribute to add navigation controls and indicators
to display slide indicators..vertical
class to switch the carousel to vertical orientation.--carousel-item
in the view timeline.The Carousel
class supports the following configuration options:
selector
(string): Default is carousel
, used to target all carousel elements.mainSelector
(string): Default is .main
, identifying the scroll container.itemSelector
(string): Default is .item
, selecting individual carousel items.autoplay
(boolean): Default is false
, determining whether the carousel auto-plays.autoplayInterval
(number): Specifies the auto-play interval in milliseconds.loop
(boolean): Default is false
, enabling or disabling looped playback of items.mouseDrag
(boolean): Default is true
, enabling slide transitions via mouse dragging.keyboardNavigation
(boolean): Default is true
, enabling navigation using keyboard keys.