Home

Awesome

<p align="center"> <a href="https://baianat.github.io/hooper/" target="_blank"> <img width="400" alt="leaps logo" src="https://github.com/baianat/hooper/blob/master/hooper.svg"> </a> </p> <p align="center"> <a href="http://isitmaintained.com/project/baianat/hooper"><img src="http://isitmaintained.com/badge/resolution/baianat/hooper.svg" alt="Average time to resolve an issue"/></a> <a href="http://isitmaintained.com/project/baianat/hooper"><img src="http://isitmaintained.com/badge/open/baianat/hooper.svg" alt="Percentage of issues still open"/></a> <a href="https://npm-stat.com/charts.html?package=hooper"><img src="https://img.shields.io/npm/dm/hooper.svg" alt="npm"/></a> <a href="https://www.npmjs.com/package/hooper"><img src="https://img.shields.io/npm/v/hooper.svg" alt="npm"/></a> </p>

Hooper

Vue.js carousel component, optimized to work with Vue.

Features

Browser Support

ChromeFirefoxSafariOperaEdgeIE
Latest ✔Latest ✔Latest ✔Latest ✔Latest ✔11 ✔

Getting started

Installation

First step is to install it using yarn or npm:

npm install hooper

# or use yarn
yarn add hooper

Use Hooper

<template>
  <hooper>
    <slide>
      slide 1
    </slide>
    <slide>
      slide 2
    </slide>
    ...
  </hooper>
</template>

<script>
  import { Hooper, Slide } from 'hooper';
  import 'hooper/dist/hooper.css';

  export default {
    name: 'App',
    components: {
      Hooper,
      Slide
    }
  }
</script>

If you are using PurgeCSS, make sure to whitelist hooper css When importing hooper/dist/hooper.css.

more info at Documentation

Available Props

PropDefaultDescription
itemsToShow1count of items to showed per view (can be a fraction).
itemsToSlide1count of items to slide when use navigation buttons.
initialSlide0index number of initial slide.
infiniteScrollfalseenable infinite scrolling mode.
centerModefalseenable center mode.
verticalfalseenable vertical sliding mode.
rtlnullenable rtl mode.
mouseDragtruetoggle mouse dragging.
touchDragtruetoggle touch dragging.
wheelControltruetoggle mouse wheel sliding.
keysControltruetoggle keyboard control.
shortDragtrueenable any move to commit a slide.
autoPlayfalseenable auto sliding to carousel. This could be changed dynamically.
playSpeed2000speed of auto play to trigger slide in ms.
transition300sliding transition time in ms.
sync''sync two carousels to slide together.
hoverPausetruepause autoPlay if the mouse enters the slide.
trimWhiteSpacefalselimit carousel to slide only when there will be no completely empty slide-space.
settings{ }an object to pass all settings.

Available CSS Properties

Please also look at the source to style the slider. An initial style can be imported as @import '~hooper/dist/hooper.css';

ClassPropertyDefaultDescription
hooperheight200pxthe default height of the slider, set to auto to scale with content