All Projects → Splidejs → Splide

Splidejs / Splide

Licence: mit
Splide is a lightweight, powerful and flexible slider and carousel, written in pure JavaScript without any dependencies.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Splide

skeleton-carousel
Carousel component. Horizontal and vertical swipe navigation
Stars: ✭ 31 (-96.06%)
Mutual labels:  slider, carousel, swipe, lazy-loading
Glide
A dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more
Stars: ✭ 6,256 (+695.93%)
Mutual labels:  lightweight, slider, carousel
react-gallery-carousel
Mobile-friendly gallery carousel 🎠 with server side rendering, lazy loading, fullscreen, thumbnails, touch, mouse emulation, RTL, keyboard navigation and customisations.
Stars: ✭ 178 (-77.35%)
Mutual labels:  carousel, swipe, lazy-loading
React Soft Slider
Simple, fast and impartial slider
Stars: ✭ 54 (-93.13%)
Mutual labels:  swipe, slider, carousel
React Native Swiper Flatlist
👆 Swiper component implemented with FlatList using Hooks & Typescript + strict automation tests with Detox
Stars: ✭ 217 (-72.39%)
Mutual labels:  swipe, slider, carousel
Slider
Touch swipe image slider/slideshow/gallery/carousel/banner mobile responsive bootstrap
Stars: ✭ 2,046 (+160.31%)
Mutual labels:  swipe, slider, carousel
React Responsive Carousel
React.js Responsive Carousel (with Swipe)
Stars: ✭ 1,962 (+149.62%)
Mutual labels:  swipe, slider, carousel
vanilla-js-carousel
Tiny (1Kb gzipped) JavaScript carousel with all the features most of us will ever need.
Stars: ✭ 87 (-88.93%)
Mutual labels:  slider, carousel, vanilla-javascript
Swiper
Most modern mobile touch slider with hardware accelerated transitions
Stars: ✭ 29,519 (+3655.6%)
Mutual labels:  swipe, slider, carousel
Darkmode Js
DarkModeJS helps you to auto detect user's time and switch theme to darkside
Stars: ✭ 328 (-58.27%)
Mutual labels:  lightweight, vanilla-javascript
Beedle
A tiny library inspired by Redux & Vuex to help you manage state in your JavaScript apps
Stars: ✭ 329 (-58.14%)
Mutual labels:  lightweight, vanilla-javascript
Vanilla Lazyload
LazyLoad is a lightweight, flexible script that speeds up your website by deferring the loading of your below-the-fold images, backgrounds, videos, iframes and scripts to when they will enter the viewport. Written in plain "vanilla" JavaScript, it leverages IntersectionObserver, supports responsive images and enables native lazy loading.
Stars: ✭ 6,596 (+739.19%)
Mutual labels:  lazy-loading, vanilla-javascript
Vue Picture Swipe
🖼 Vue Picture Swipe Gallery (a gallery of image with thumbnails, lazy-load and swipe) backed by photoswipe
Stars: ✭ 322 (-59.03%)
Mutual labels:  swipe, carousel
Vue Flickity
A Vue Slider / Carousel Component for Flickity.js
Stars: ✭ 339 (-56.87%)
Mutual labels:  slider, carousel
Vue Easy Slider
Slider Component of Vue.js.
Stars: ✭ 313 (-60.18%)
Mutual labels:  swipe, slider
Vue Gallery
📷 Responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers.
Stars: ✭ 405 (-48.47%)
Mutual labels:  slider, carousel
Vue Slick Carousel
🚥Vue Slick Carousel with True SSR Written for ⚡Faster Luxstay
Stars: ✭ 447 (-43.13%)
Mutual labels:  slider, carousel
Autocomplete.js
Simple autocomplete pure vanilla Javascript library.
Stars: ✭ 3,428 (+336.13%)
Mutual labels:  lightweight, vanilla-javascript
Tiny Slider
Vanilla javascript slider for all purposes.
Stars: ✭ 4,298 (+446.82%)
Mutual labels:  slider, carousel
Dragdropswiperecyclerview
Kotlin Android library that extends RecyclerView to support gestures like drag & drop and swipe, among others. It works with vertical, horizontal and grid lists.
Stars: ✭ 469 (-40.33%)
Mutual labels:  swipe, drag

Splide

Splide is a lightweight, powerful and flexible slider and carousel, written in pure JavaScript without any dependencies.

News

  • Transform Splidejs to the organization.
  • Add slideFocus and waitForTransition options.
  • Add type definitions for typescript.
  • React Splide is released.
  • Vue Splide is released.
  • Add resetProgress and throttle options.
  • Breakpoints accept drag and pagination.
  • Add some themes.
  • Grid extension is released.
  • Auto Width is implemented. Each slide can have its own width.
  • Breakpoints accept 'destroy' option.
  • Merge Slides component to Elements.
  • Splide can be destroyed.
  • Add or remove slides dynamically.
  • Video extension is released.
  • URL Hash Navigation extension is released.

Features

  • Pure JavaScript without any dependencies
  • Small size, less than 29kB(11kB gzipped)
  • Flexible and extensible
  • Multiple slides
  • Slide or fade transition by CSS
  • Responsive, supporting breakpoints
  • Accepting CSS relative units, such as vw, %, rem, etc
  • No need to crop images
  • Autoplay with progress bar and play/pause buttons
  • "Right to left" and vertical direction
  • Mouse drag and touch swipe
  • Nested slider
  • Lazy loading
  • Thumbnail slider
  • Accessibility friendly, supporting keyboard control and ARIA attributes
  • Dynamically adding/removing slides
  • Internet Explorer 10

Installation

There are 3 ways to install the Splide on your site.

  • NPM
  • Download
  • CDN

Only the NPM way is explained in the following steps. Visit this page for other methods.

  1. Get the latest version by NPM:
    $ npm install @splidejs/splide
    
  2. Link to the stylesheet:
    <link rel="stylesheet" href="node_modules/@splidejs/splide/dist/css/splide.min.css">
    
  3. Write HTML for building a slider:
    <div id="splide" class="splide">
      <div class="splide__track">
        <ul class="splide__list">
          <li class="splide__slide">Slide 01</li>
          <li class="splide__slide">Slide 02</li>
          <li class="splide__slide">Slide 03</li>
        </ul>
      </div>
    </div>
    
  4. Initialize Splide. The selector accepts an ID, a class name or an Element itself:
    import Splide from '@splidejs/splide';
    new Splide( '#splide' ).mount();
    
    Note that only the first element will be initialized even if using a class name.

See the Integration section for your Vue or React project.

Options

Changing Options

Pass an object to the second argument of the Splide constructor:

new Splide( '#splide', {
  type   : 'loop',
  perPage: 3,
} );

Or set a data-splide attribute to a root element in a JSON format:

<div id="splide" class="splide" data-splide='{"type":"loop","perPage":3}'>
</div>

Available Options

Here is a list of options and brief explanations. Visit this page for more details.

  • type: Determine a slider type.
  • rewind: Whether to rewind a slider before the first slide or after the last one.
  • speed: Transition speed in milliseconds.
  • rewindSpeed: Transition speed on rewind in milliseconds.
  • waitForTransition: Whether to prevent any actions while a slider is transitioning.
  • width: Define slider max width.
  • height: Define slider height.
  • fixedWidth: Fix width of slides.
  • fixedHeight: Fix height of slides.
  • heightRatio: Determine height of slides by ratio to a slider width.
  • autoWidth: If true, slide width will be determined by the element width itself. This is for a horizontal slider.
  • autoHeight: If true, slide height will be determined by the element height itself. This is for a vertical slider.
  • perPage: Determine how many slides should be displayed per page.
  • perMove: Determine how many slides should be moved when a slider goes to next or previous page.
  • clones: Manually determine how many clones should be generated on one side.
  • start: Start index.
  • focus: Determine which slide should be focused.
  • gap: Gap between slides.
  • padding: Set padding-left/right in horizontal mode or padding-top/bottom in vertical one.
  • easing: Animation timing function for CSS transition.
  • arrows: Whether to append arrows.
  • arrowPath: Change the arrow SVG path.
  • pagination: Whether to append pagination(indicator dots).
  • autoplay: Whether to enable autoplay.
  • interval: Autoplay interval in milliseconds.
  • pauseOnHover: Whether to stop autoplay while a slider is hovered.
  • pauseOnFocus: Whether to stop autoplay while a slider elements are focused.
  • resetProgress: Whether to reset progress of the autoplay timer when resumed.
  • lazyLoad: Enable lazy load for images.
  • preloadPages: Determine how many pages around an active slide should be loaded beforehand. This only works the lazyLoad option is “nearby”.
  • keyboard: Whether to control a slider via keyboard.
  • drag: Whether to allow mouse drag and touch swipe.
  • dragAngleThreshold: The angle threshold for drag.
  • swipeDistanceThreshold: Distance threshold for determining if the action is "flick" or "swipe".
  • flickVelocityThreshold: Velocity threshold for determining if the action is "flick" or "swipe".
  • flickPower: Determine power of flick. The larger number this is, the farther a slider runs by flick.
  • flickMaxPages: Limit a number of pages to move by flick.
  • direction: Slider direction.
  • cover: Whether to convert an img src to background-image of its parent element. height, fixedHeight or heightRatio is required.
  • accessibility: Whether to enable accessibility(ARIA attributes) or not.
  • slideFocus: Whether to add tabindex="0" to visible slides or not.
  • isNavigation: Determine if a slider is navigation for another.
  • trimSpace: Whether to trim spaces before the fist slide or after the last one.
  • updateOnMove: If true, "is-active" class added to the slide element before transition.
  • throttle: Throttle duration for the resize event.
  • breakpoints: Breakpoints definitions.
  • classes: Collection of class names.
  • i18n: Collection of texts for i18n.

Extensions

  • Video: Assign HTML video, YouTube or Vimeo to slides.
  • URL Hash Navigation: Listen to hash change and move a slider to a slide having the hash data attribute.
  • Grid: Create rows and cols in a slider.

Integration

Easy to integrate the Splide slider or carousel into your Vue or React project.

API and Extension

Splide provides some APIs and the way to customize the behaviour programmatically.

License

Splide is released under the MIT license. © 2020 Naotoshi Fujita

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].