npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@samwood/vue-carousel

v0.1.98

Published

## Installation

Readme

vue-carousel

Installation

  1. Install the npm package

    npm install @samwood/vue-carousel
  2. Import VueCarousel into Vue component script

    // my-component.vue
    
    <template>
      <MyComponent>...</MyComponent>
    </template>
    
    <script>
    import VueCarousel from '@samwood/vue-carousel';
    
    export default {
      name: 'MyComponent',
      components: {
        VueCarousel
      }
    }
    </script>
  3. Add VueCarousel to Vue component template

    To populate the slides, you will need to add <template> for each slide with a v-slot[0] starting at base 0. Each v-slot should increment by 1 for every slide.

    // my-component.vue
    
    <template>
      <MyComponent>
        <VueCarousel>
          <template v-slot[0]>
            <MyChildComponent />
          </template>
          <template v-slot[1]>
            <MyChildComponent />
          </template>
          <template v-slot[3]>
            <MyChildComponent />
          </template>
        </VueCarousel>
      </MyComponent>
    </template>
    
    <script>
    ...
    </script>

    Optionally, you can dynamically change the v-slot to avoid repeated code.

    // my-component.vue
    
    <template>
      <MyComponent>
        <VueCarousel>
          <template v-for="n in slides" v-slot[n-1]>
            <MyChildComponent :key="`slide-${n-1}`" />
          </template>
        </VueCarousel>
      </MyComponent>
    </template>
    
    <script>
    ...
    </script>

Config

Example

Vue carousel takes a config prop - an object contain various keys to change the functionality and appearance of the component.

<vue-carousel
  :config="{
    slidesVisible: {...},
    staticBreakpoint: "md",
    loop: true
  }"
>
...
</vue-carousel>

Parameters

Event API

Styling

Although the controls have options to pass styling through a JS object, this isn't always ideal, especially when you want to use your own CSS variables and mixins. You will find below a list of CSS classes that you can target to override existing styles.

Carousel classes

.v-carousel

If you set a breakpoint to become static, you may want to change the layout of the slides. You can do this by targetting the following class:

.v-carousel--static

Controls classes

.v-carousel__controls__btn

.v-carousel__controls__btn--prev
.v-carousel__controls__btn--next
.v-carousel__controls__btn--disabled

.v-carousel-pagination
.v-carousel-pagination__list // ul/ol element containing li elements
.v-carousel-pagination__li // li element wrapping the button
.v-carousel-pagination__btn
.v-carousel-pagination__btn--active
.v-carousel-pagination__btn--number

Slides

.v-carousel__slide

Troubleshooting

Note: Ensure that you do not apply any attributes to slide slots within the carousel that should not be duplicated such as id as if you set loop to true, the content in these slides will be duplicated and will cause issues.

The first slide is missing content

The carousel uses base-0 incrementing numbers for slot names.

v-for="n in 10" will produce numbers 1-10 for n. You will need to use v-slot:[n-1] to include the first slides content.

My styling isn't being applied to the carousel elements

If you are using scoped styles, ensure that you are using ::v-deep before targetting the carousel class.

Example

<style lang="scss scoped>
.my-component {
  & ::v-deep .v-carousel--static {
    display: grid;
  }
}
</style>

The carousel won't autoplay when off-screen

The carousel uses an Intersection Observer to remove the autoplay-interval when the carousel is not visible on screen.

This has been done to improve efficiency of the browser so that the carousel is not carrying out performance-expensive animations that may interfer with the user's experience.

Autoplay will be enabled again when the carousel is visible again.

The carousel is not looping when loop is true

If config.group is set to true, ensure that the total slide-count can be divided by your config.slidesVisible value at the current breakpoint without remainder. e.g

slide-count (10) % config.slidesVisible.xs (2) = 0

slide-count (10) % config.slidesVisible.sm (3) = 1

If there is a remainder, loop will be disabled because there will not be enough items to fill out the last group of slides.