Carousel
A Slideshow for cycling images in confined spaces
Class props
Carousel component
A Slideshow for cycling images in confined spaces
html
<o-carousel></o-carousel>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
arrows | Show next / prev arrows | boolean | - | From config: carousel: { |
arrowsHover | Show next / prev arrows only on hover | boolean | - | From config: carousel: { |
autoplay | Move item automaticalls after interval | boolean | - | false |
breakpoints | Define these props for different screen sizes | Record<number, any> | - | Default function (see source code) |
dragable | Enable drag mode | boolean | - | true |
iconNext | Icon name for next icon | string | - | From config: carousel: { |
iconPack | Icon pack to use | string | mdi , fa , fas and any other custom icon pack | From config: carousel: { |
iconPrev | Icon name for previous icon | string | - | From config: carousel: { |
iconSize | Icon size | string | small , medium , large | From config: carousel: { |
indicatorInside | Place indicators inside the carousel | boolean | - | false |
indicatorMode | Indicator interaction mode | string | click , hover | "click" |
indicatorPosition | Position of the indicator - depends on used theme | string | - | From config: carousel: { |
indicatorStyle | Style of the indicator - depends on used theme | string | - | From config: carousel: { |
indicators | Enable indicators | boolean | - | true |
interval | Timer interval for autoplay | number | - | From config: carousel: { |
itemsToList | Number of items to switch at once | number | - | From config: carousel: { |
itemsToShow | Number of items to show at once | number | - | From config: carousel: { |
v-model | The index of the current active element | number | - | 0 |
overlay | Show an overlay | boolean | - | false |
override | Override existing theme classes completely | boolean | - | |
pauseHover | Pause autoplay on hover | boolean | - | false |
repeat | Repeat from the beginning after reaching the end | boolean | - | false |
Events
Event name | Properties | Description |
---|---|---|
update:modelValue | value number - updated modelValue prop | modelValue prop two-way binding |
scroll | value number - scroll index | on carousel scroll event |
click | event event - native event | on item click event |
Slots
Name | Description | Bindings |
---|---|---|
default | Display carousel item | |
arrow | Override the arrows | has-prev boolean - has prev arrow buttonprev (): void - switch to prev item functionhas-next boolean - has next arrow buttonnext (): void - switch to next item function |
indicators | Override the indicators | active number - active indexswitch-to (idx: number): void - switch to item functionindicator-index number - current indicator index |
indicator | Override the indicator elements | index index - indicator index |
overlay | Overlay element |
CarouselItem component
A Slideshow item used by the carousel
html
<o-carousel-item></o-carousel-item>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
ariaRole | Role attribute to be passed to the div wrapper for better accessibility | string | - | From config: carousel: { |
clickable | Make item clickable | boolean | - | false |
override | Override existing theme classes completely | boolean | - |
Slots
Name | Description | Bindings |
---|---|---|
default | Default content |
Sass variables
Current theme ➜ Oruga
SASS Variable | Default |
---|---|
$carousel-arrow-background | var(--#{$prefix}white) |
$carousel-arrow-color | var(--#{$prefix}primary) |
$carousel-arrow-icon-spaced | 1.5rem |
$carousel-arrow-top | 50% |
$carousel-arrow-size | 1.5rem |
$carousel-arrow-border-radius | var( --#{$prefix}base-border-radius-rounded) |
$carousel-arrow-border | 1px solid $carousel-arrow-background |
$carousel-arrow-transition | var(--#{$prefix}transition-duration) var(--#{$prefix}transition-timing) |
$carousel-indicators-background | rgba(var(--#{$prefix}white), 0.5) |
$carousel-indicators-padding | 0.5rem |
$carousel-indicator-margin | 0 0.5rem 0 0 |
$carousel-indicator-color | var(--#{$prefix}primary) |
$carousel-indicator-background | var(--#{$prefix}white) |
$carousel-indicator-border | 1px solid $carousel-indicator-color |
$carousel-indicator-active-background | $carousel-indicator-color |
$carousel-indicator-active-border | 1px solid $carousel-indicator-color |
$carousel-indicator-transition | var(--#{$prefix}transition-duration) var(--#{$prefix}transition-timing) |
$carousel-indicator-size | 10px |
$carousel-indicator-dots-border-radius | var( --#{$prefix}base-border-radius) |
$carousel-indicator-lines-height | 5px |
$carousel-indicator-lines-width | 25px |
$carousel-items-transition | all var(--#{$prefix}transition-duration) var(--#{$prefix}transition-timing) 0s |
$carousel-item-border | 2px solid transparent |
$carousel-overlay-background | hsla(0, 0%, 4%, 0.86) |
$carousel-overlay-zindex | 40 |
See ➜ 📄 Full scss file
Current theme ➜ Bulma
SASS Variable | Default |
---|---|
$carousel-arrow-background | css.getVar("scheme-main") |
$carousel-arrow-color | css.getVar("primary") |
$carousel-arrow-icon-spaced | 1.5rem |
$carousel-arrow-top | 50% |
$carousel-indicator-background | rgba(css.getVar("scheme-invert"), 0.5) |
$carousel-indicator-border | css.getVar("scheme-main") |
$carousel-indicator-color | css.getVar("primary") |
$carousel-indicator-spaced | 0.5rem |
$carousel-overlay-background | rgba(css.getVar("scheme-invert"), 0.86) |
$carousel-overlay-z | 40 |
See ➜ 📄 Full scss file
Current theme ➜ Bootstrap
The theme does not have any custom variables for this component.