@beyonk/svelte-carousel
Advanced tools
Comparing version 1.4.0 to 1.5.0
{ | ||
"name": "@beyonk/svelte-carousel", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "A super simple infinite carousel", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -95,4 +95,30 @@ <p align="center"> | ||
### Autoplay | ||
You can cause the carousel to autoplay by setting the value of the `autoplay` to a millisecond amount. | ||
```jsx | ||
<Carousel ref:carousel current="1" autoplay="1000"> | ||
<button slot="prev">< Prev</button> | ||
<button slot="next">Next ></button> | ||
<Slide> | ||
<h2>1</h2> | ||
</Slide> | ||
... | ||
<Slide> | ||
<h2>9</h2> | ||
</Slide> | ||
</Carousel> | ||
``` | ||
You can also manually pause and start the carousel by calling the component methods: | ||
```js | ||
const { carousel } = this.refs // We grab a component reference from the 'ref:carousel' attribute above. | ||
carousel.start() | ||
carousel.stop() | ||
``` | ||
## Thanks | ||
Huge thanks to [Nick A Walsh](https://codepen.io/nickawalsh/) for his original carousel, [Rich Harris](https://github.com/Rich-Harris) for his immense work on [Svelte](https://svelte.technology), and [Stu Plumbley](https://github.com/stuplum) for his limitless flexbox expertise. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
11664
123