Carousel

Loop a series of images or texts in a limited space

Basic usage

Combine el-carousel with el-carousel-item, and you'll get a carousel. Content of each slide is completely customizable, and you just need to place it inside el-carousel-item tag. By default the carousel switches when mouse hovers over an indicator. Set trigger to click, and the carousel switches only when an indicator is clicked.

Switch when indicator is hovered (default)
Switch when indicator is clicked

Motion blur 2.6.0

Add motion blur to infuse dynamism and smoothness into the carousel.

Enabling motion blur enhances the dynamism and smoothness of the carousel. By default, the motion-blur parameter is set to false, activating this feature and providing a visually engaging experience.

Motion blur the switch (default)

Vertical effect

Indicators

Indicators can be displayed outside the carousel

The indicator-position attribute determines where the indicators are located. By default they are inside the carousel, and setting indicator-position to outside moves them outside; setting indicator-position to none hides the indicators.

Arrows

You can define when arrows are displayed

The arrow attribute determines when arrows are displayed. By default they appear when mouse hovers over the carousel. Setting arrow to always or never shows/hides the arrows permanently.

Auto height

When the height of carousel is set to auto, the carousel height will be automatically set according to the height of the carousel item

each carousel-item has a different height

Card mode

When a page is wide enough but has limited height, you can activate card mode for carousels

Setting type to card activates the card mode. Apart from the appearance, the biggest difference between card mode and common mode is that clicking the slides at both sides directly switches the carousel in card mode.

Vertical

By default, direction is horizontal. Let carousel be displayed in the vertical direction by setting direction to vertical.

normal vertical layout

card vertical layout

NameDescriptionTypeDefault
heightheight of the carouselstring''
initial-indexindex of the initially active slide (starting from 0)number0
triggerhow indicators are triggeredenumhover
autoplaywhether automatically loop the slidesbooleantrue
intervalinterval of the auto loop, in millisecondsnumber3000
indicator-positionposition of the indicatorsenum''
arrowwhen arrows are shownenumhover
typetype of the Carouselenum''
cardScale 2.7.8when type is card, scaled size of secondary cardsnumber0.83
loopdisplay the items in loopbooleantrue
directiondisplay directionenumhorizontal
pause-on-hoverpause autoplay when hoverbooleantrue
motion-blur 2.6.0infuse dynamism and smoothness into the carouselbooleanfalse
NameDescriptionType
changetriggers when the active slide switches, it has two parameters, the one is the index of the new active slide, and other is index of the old active slideFunction
NameDescriptionSubtags
defaultcustomize default contentCarousel-Item
MethodDescriptionType
activeIndex 2.7.8active slide indexnumber
setActiveItemmanually switch slide, index of the slide to be switched to, starting from 0; or the name of corresponding el-carousel-itemFunction
prevswitch to the previous slideFunction
nextswitch to the next slideFunction
NameDescriptionTypeDefault
namename of the item, can be used in setActiveItemstring''
labeltext content for the corresponding indicatorstring / number''
NameDescription
defaultcustomize default content

Source

ComponentStyleDocs

Contributors