# v-siema

> Vue wrapper for Siema carousel

Latest version **0.0.6** (published 2019-02-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install v-siema
pnpm add v-siema
yarn add v-siema
bun add v-siema
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2019-02-01 |
| First published | 2018-05-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 456.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Robbin Johansson |
| Maintainers | robbinfellow, robbinworks |
| Keywords | vue, siema, slider, carousel |

## Links

- npm: https://www.npmjs.com/package/v-siema
- Repository: https://github.com/robbinworks/v-siema
- Homepage: https://github.com/robbinworks/v-siema/
- Issues: https://github.com/robbinworks/v-siema/issues
- npm.io page: https://npm.io/package/v-siema

## Alternatives

- [adhdev](https://npm.io/package/adhdev.md) — 11.1K weekly downloads
- [react-slide-button](https://npm.io/package/react-slide-button.md) — 310 weekly downloads
- [better](https://npm.io/package/better.md) — 42 weekly downloads
- [react-native-swipe-image](https://npm.io/package/react-native-swipe-image.md) — 22 weekly downloads
- [nl.fokkezb.pulltorefresh](https://npm.io/package/nl.fokkezb.pulltorefresh.md) — 11 weekly downloads

## Recent versions

- 0.0.6 (latest) — 2019-02-01
- 0.0.5 — 2019-01-31
- 0.0.4 — 2018-10-19
- 0.0.3 — 2018-06-01
- 0.0.2 — 2018-05-23
- 0.0.1 — 2018-05-23

## README

[![Latest Version on NPM](https://img.shields.io/npm/v/v-siema.svg?style=flat-square)](https://npmjs.com/package/v-siema)
[![Total Downloads on NPM](https://img.shields.io/npm/dt/v-siema.svg)](https://www.npmjs.com/package/v-siema)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/robbinworks/v-siema/master.svg?style=flat-square)](https://travis-ci.org/robbinworks/v-siema)

# V-Siema

Vue wrapper for Siema carousel.

> Siema is a lightweight (only 3kb gzipped) carousel plugin with no dependencies and no styling. It is 100% open source and [available on Github.](https://github.com/pawelgrzybek/siema)

Full docs with examples: [https://pawelgrzybek.com/siema/](https://pawelgrzybek.com/siema/).

## Demo

TBD

## Installation
```shell
$ yarn add v-siema --dev
# or ...
$ npm i v-siema --save-dev
```

Register the component:

```javascript
import Vue from 'vue';
import { Siema } from 'v-siema';

Vue.component('siema', Siema);
```

Alternatively using `Vue.use()` to register the component:

```javascript
import Siema from 'v-siema';

Vue.use(Siema);
```

## Usage

Display the component using any custom markup that fits your use case:

``` vue
<template>
    <div>
        <siema
            ref="siema"
            @init="init"
            @change="change"
            :loop="true"
        >
            <!-- The Slides -->
            <div v-for="n in 5">
                <img src="http://via.placeholder.com/1920x1080" :alt="'Slide ' + n">
            </div>
        </siema>

        <!-- Example using prev/next buttons -->
        <div>
            <a @click="prev">Prev</a>
            <a @click="next">Next</a>
        </div>
    </div>
</template>

<script>
import { Siema } from 'v-siema';
Vue.component('siema', Siema);

export default {
    methods: {
        init() {
            console.log('Initialized!');
        },

        change() {
            console.log('Changed!');
        },

        prev() {
            this.$refs.siema.prev();
        },
        
        next() {
            this.$refs.siema.next();
        },
    },
};
</script>
```

## Available properties

Prop                | Data Type  | Default  | Required   | Description
------------------- | ---------- | --------- | -------   | -----------
`autoplay`          | Boolean        | `false`   | `false`   | Enable autoplay
`autoplay-duration` | Number         | `3000`    | `false`   | Autoplay duration between slide change
`selector`          | String         | `siema`   | `false`   | The selector to use as a carousel
`duration`          | Number         | `500`     | `false`   | Slide transition duration in milliseconds
`easing`            | String         | `ease`    | `false`   | CSS transition-timing-function — describes acceleration curve
`per-page`          | Number, Object | `1`       | `false`   | The number of slides to be shown per page
`start-index`       | Number         | `0`       | `false`   | Index (zero-based) of the starting slide
`draggable`         | Boolean        | `true`    | `false`   | Use dragging and touch swiping
`multiple-drag`     | Boolean        | `true`    | `false`   | Allow dragging to move multiple slides
`threshold`         | Number         | `20`      | `false`   | Touch and mouse dragging threshold (in px)
`loop`              | Boolean        | `false`   | `false`   | Enable loop
`rtl`               | Boolean        | `false`   | `false`   | Enables layout for languages written from right to left
`@init`             | Function       |           | `false`   | Runs immediately after initialization
`@change`           | Function       |           | `false`   | Runs after slide change

## API

All of [Siema's methods](https://github.com/pawelgrzybek/siema#api) are available:

**`this.$refs.siema.prev(howManySlides = 1, callback);`**  
Go to previous item. Optionally pass `howManySlides` (number) and `callback` (function).

**`this.$refs.siema.next(howManySlides = 1, callback);`**  
Go to next item. Optionally pass `howManySlides` (number) and `callback` (function).

**`this.$refs.siema.goTo(index, callback);`**  
Go to item at particular `index` (number). Optionally pass `callback` (function).

**`this.$refs.siema.remove(index, callback);`**  
Remove item at particular `index` (number). Optionally pass `callback` (function).

**`this.$refs.siema.insert(item, index, callback);`**  
Insert new `item` (DOM element) at specific `index` (number). Optionally pass `callback` (function).

**`this.$refs.siema.prepend(item, callback);`**  
Prepend new `item` (DOM element). Optionally pass `callback` (function).

**`this.$refs.siema.append(item, callback);`**  
Append new `item` (DOM element). Optionally pass `callback` (function).

**`this.$refs.siema.destroy(restoreMarkup = false, callback);`**  
Remove all event listeners on the instance. Use `restoreMarkup` to restore the initial markup inside selector. Optionally pass `callback` (function).

**`this.$refs.siema.currentSlide;`**  
Prints current slide index.

### Extras

**`this.$refs.siema.init();`**  
Initiate the slider instance. Useful when you'd want to initiate the slider manually. Please note that the slider component is automatically initiated when mounted.

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Credits

* [Robbin Johansson](https://github.com/robbinworks)
* [pawelgrzybek/siema](https://github.com/pawelgrzybek/siema)
* [spatie/skeleton-vue](https://github.com/spatie/skeleton-vue)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

---
_Source: https://npm.io/package/v-siema · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
