1.1.11 • Published 1 year ago

@vueimple/carousel v1.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@vueimple/carousel

Software License

Simple single carousel component

Features

  • Autoplay
  • Multiple slides
  • Breakpoints
  • Drag and touch slide change (please set draggable=false for your images to avoid not-allowed cursor)

Options

OptionTypeDefaultDescription
animationstring'linear'animation easing name. "linear", "ease", "ease-in", "ease-out", and "ease-in-out", or a custom "cubic-bezier" value like "cubic-bezier(0.42, 0, 0.58, 1)"
arrowsbooleantrueis show arrows
arrowsOutsidebooleanfalseis arrows outside of carousel
autoplaynumber2000animation intervals in milliseconds
dotsbooleantrueis show dots
dotsOutsidebooleantrueis dots outside of carousel
draggablebooleantrueallow change slides by drag or touch
durationnumber500animation duration in milliseconds
gapstring'10px'gap between slides when more than one slide per page
infinitebooleantrueenable infinite slides change. If infinite disabled, left arrow wouldn't show on the first slide and right arrow wouldn't show on the last slide
responsiveRecord<string, ResponsiveSettings>{}responsive settings where property is valid media query min-width value. See below
slidesPerPagenumber1number of slides per page to show

Responsive options

All properties are optional

OptionTypeDescription
arrowsbooleanis show arrows
arrowsOutsidebooleanis arrows outside of carousel
autoplaybooleananimation intervals in milliseconds
dotsbooleanis show dots
dotsOutsidebooleanis dots outside of carousel
draggablebooleanallow change slides by drag or touch
gapstringgap between slides when more than one slide per page
slidesPerPagenumbernumber of slides per page to show

Example

{
    autoplay: 0,
    arrowsOutside: true,
    dotsOutside: false,
    slidesPerPage: 3,
    gap: '20px',
    responsive: {
      800: {
        autoplay: 0,
        slidesPerPage: 1,
        gap: '10px'
      }
    }
  }
}

Methods

  • next - go to next slide
  • prev - go to previous slide
  • goTo(index: number) - go to {index} slide
  • start - start animation
  • stop = stop animation

Events

  • change - fires before slide change

Slots

NameDescriptionParameters
prevprevious arrow
nextnext arrow
dotsnavigationcurrent-slide, is-active
1.1.11

1 year ago