0.9.3-6 • Published 3 years ago

vue-cat-carousel v0.9.3-6

Weekly downloads
96
License
MIT
Repository
github
Last release
3 years ago

🐱🐱🐱 Vue-Cat-Carousel 🐱🐱🐱

Simple, customizable, reactive and lightest Carousel

Install

npm i -S vue-cat-carousel
or
npm install --save vue-cat-carousel

Preview

Desktop Preview

npm.io

Mobile Preview

npm.io

Usage

Plugin install:

Global install

import Vue from 'vue'
import CatCarousel from 'vue-cat-carousel'

Vue.use(CatCarousel)

Local install

components: {
  CatCarousel: () => import('vue-cat-carousel')
}

How to use it in HTML

<cat-carousel
    :items="items"
    :item-per-page="5"
    :indicators-config="{activeColor: '#000', size: 10, color: '#d1d1d1', hideIndicators: false}"
  >
    <template
      slot="item"
      slot-scope="{data, index}"
    >
      <div class="item">{{index}} {{data.name}} </div>
    </template>
  </cat-carousel>
import { CatCarousel } from 'vue-cat-carousel'

new Vue({
  el: 'body',
  components: {
    CatCarousel
  },
  data() {
    return {
      items: [{name: 'hans'}, {name: 'sagita'}]
    }
  }
})

Props

Slider:

nametypedefaultdescription
itemslist[]List of items in loop
item-per-pagenumber5List of items in one page
centerModeObjectCENTER_MODE_DEFAULT_CONFIGAllow to center carousel item with partial prev/next slides
indicators-configObjectINDICATORS_DEFAULT_CONFIGdefine carousel indicators item size

INDICATORS_DEFAULT_CONFIG

propertytypevaluedescription
sizenumber16size of indicators in pixel
colorstring'#d6d6d6'color of indicators (hex, rgb, etc)
activeColorstring'#0095da'color of active indicator (hex, rgb, etc)
hideIndicatorsbooleanfalseshow and hide carousel indicators
prefixstring''add prefix for :key item name

INDICATORS_DEFAULT_CONFIG

propertytypevaluedescription
enabledbooleanfalseenable center mode carousel
paddingCenternumber10sizes of padding in percentage

Slots

slotslot-scopedescription
itemdata, indexcustomize the design of carousel item
prev-navigationprevcustomize slide left navigation
next-navigationnextcustomize slide right navigation

Previous navigation:

<cat-carousel
    :items="items"
    :item-per-page="5"
    :indicators-config="{activeColor: '#000', size: 10, color: '#d1d1d1', hideIndicators: false}"
  >
    <template
      slot="prev-navigation"
      slot-scope="{prev}"
    >
      <div class="custom-navigation" @click="prev"></div>
    </template>
  </cat-carousel>

Next navigation:

<cat-carousel
    :items="items"
    :item-per-page="5"
    :indicators-config="{activeColor: '#000', size: 10, color: '#d1d1d1', hideIndicators: false}"
    :prefix="'nike'"
  >
    <template
      slot="prev-navigation"
      slot-scope="{next}"
    >
      <div class="custom-navigation" @click="next"></div>
    </template>
  </cat-carousel>

Center mode carousel:

npm.io

<cat-carousel
    :items="items"
    :item-per-page="5"
    :centerMode="{enabled: true, paddingCenter: 10}"
    :indicators-config="{activeColor: '#000', size: 10, color: '#d1d1d1', hideIndicators: false}"
  >
  </cat-carousel>

License

MIT

0.9.3-6

3 years ago

0.9.3-5

4 years ago

0.9.3-4

4 years ago

0.9.3-3

4 years ago

0.9.3-2

4 years ago

0.9.3-1

4 years ago

0.9.3

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.4

4 years ago

0.8.3

4 years ago

0.8.1

4 years ago

0.8.2

4 years ago

0.8.0

4 years ago

0.7.3

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago