Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Vue Awesome Swiper | 12,559 | 2,243 | 449 | 6 months ago | 58 | March 19, 2022 | 309 | mit | JavaScript | |
🏆 Swiper component for @vuejs | ||||||||||
Tiny Slider | 4,917 | 99 | 48 | a month ago | 84 | October 26, 2021 | 362 | mit | HTML | |
Vanilla javascript slider for all purposes. | ||||||||||
Splide | 3,821 | 32 | a month ago | 148 | September 21, 2022 | 44 | mit | TypeScript | ||
Splide is a lightweight, flexible and accessible slider/carousel written in TypeScript. No dependencies, no Lighthouse errors. | ||||||||||
Gallery | 3,635 | 8 months ago | 12 | other | JavaScript | |||||
blueimp Gallery is a touch-enabled, responsive and customizable image & video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. It features swipe, mouse and keyboard navigation, transition effects, slideshow functionality, fullscreen support and on-demand content loading. | ||||||||||
Siema | 3,447 | 109 | 41 | 3 months ago | 28 | February 14, 2018 | 56 | other | JavaScript | |
Siema - Lightweight and simple carousel in pure JavaScript | ||||||||||
React Image Gallery | 3,410 | 517 | 92 | 6 days ago | 110 | July 30, 2022 | 14 | mit | JavaScript | |
React carousel image gallery component with thumbnail support 🖼 | ||||||||||
Nuka Carousel | 2,886 | 491 | 133 | 12 days ago | 131 | September 22, 2022 | 27 | other | TypeScript | |
Small, fast, and accessibility-first React carousel library with an easily customizable UI and behavior to fit your brand and site. | ||||||||||
React Responsive Carousel | 2,433 | 794 | 137 | 23 days ago | 122 | March 03, 2022 | 29 | mit | TypeScript | |
React.js Responsive Carousel (with Swipe) | ||||||||||
Lightslider | 1,967 | 61 | 16 | 2 years ago | 6 | October 25, 2016 | 273 | mit | JavaScript | |
JQuery lightSlider is a lightweight responsive Content slider with carousel thumbnails navigation | ||||||||||
Vue Carousel | 1,626 | 329 | 59 | a year ago | 42 | March 21, 2019 | 224 | mit | JavaScript | |
A flexible, responsive, touch-friendly carousel for Vue.js |
Svelte Carousel / Slider
This is a ground-up rewrite of the original Svelte Carousel/Slider using Svelte v3, and Siema, the goal being a fully working carousel with a tiny size.
This library is pure javascript, so can be used with any framework you like.
npm install
npm run dev # http://localhost:12001
npm i -D @beyonk/svelte-carousel
<Carousel>
<div class="slide-content">Slide 1</div>
<div class="slide-content">Slide 2</div>
<div class="slide-content">Slide 3</div>
<div class="slide-content">Slide 4</div>
</Carousel>
<script>
import Carousel from '@beyonk/svelte-carousel'
import { ChevronLeftIcon, ChevronRightIcon } from 'svelte-feather-icons'
</script>
You can set the controls to be anything you like, though the default height and width are set to 40px. Just use the slots available to insert your own content.
npm i -D svelte-feather-icons
<Carousel>
<span class="control" slot="left-control">
<ChevronLeftIcon />
</span>
<div class="slide-content">Slide 1</div>
...
<div class="slide-content">Slide n</div>
<span class="control" slot="right-control">
<ChevronRightIcon />
</span>
</Carousel>
<script>
import Carousel from './Carousel.svelte'
import { ChevronLeftIcon, ChevronRightIcon } from 'svelte-feather-icons'
</script>
If you need to override height and width, you can use CSS:
.control :global(svg) {
width: 100%;
height: 100%;
color: #fff;
border: 2px solid #fff;
border-radius: 32px;
}
You can pass the following attributes:
Attribute | Type | Default Value | Description |
---|---|---|---|
loop | boolean | true | At the end of the carousel, loop through to the first slide again, seamlessly |
perPage | integer | 3 | Number of slides on a single page. Note that this needs to be less than or equal to the number of slides in your carousel |
autoplay | integer | 0 | Auto-change slide at an interval (in milliseconds). 0 means don't autoplay. |
duration | number | 200 | Slide transition duration in milliseconds. |
easing | string | 'ease-out' | It is like a CSS transition-timing-function — describes acceleration curve. |
startIndex | number | 0 | Index (zero-based) of the starting slide. |
draggable | boolean | true | Use dragging and touch swiping. |
multipleDrag | boolean | true | Allow dragging to move multiple slides. |
dots | boolean | true | Toggles visibility of slider dots. |
controls | boolean | true | Toggles visibility of slider controls. dots. |
threshold | number | 20 | Touch and mouse dragging threshold (in px). |
rtl | boolean | false | Enables layout for languages written from right to left (like Hebrew or Arabic). |
perPage can also be set to a responsive object, to change the number of slides based on screen width:
<Carousel perPage={{ 800: 3, 500: 2 }}>
// will show 1 slide below 500px width, 2 at 500, 3 at 800.
The Carousel components emits the following events:
Name | Data | Description |
---|---|---|
change |
{ currentSlide, slideCount } |
currentSlide : The current slide index. Can be a positive or negative integer. slideCount : The number of slides. |
You can call left, right, go(slideNumber), pause and resume functions on the slider. For example, for pausing the autoslide while the mouse is hover the carousel
<Carousel bind:this={carousel} on:mouseenter={enter} on:mouseleave={leave}>
<div class="slide-content">Slide 1</div>
...
<div class="slide-content">Slide n</div>
</Carousel>
<script>
import Carousel from './Carousel.svelte'
let carousel;
function enter() {
carousel.pause();
}
function leave() {
carousel.resume();
}
</script>