Socket
Socket
Sign inDemoInstall

swiper

Package Overview
Dependencies
2
Maintainers
1
Versions
324
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    swiper

Most modern mobile touch slider and framework with hardware accelerated transitions


Version published
Weekly downloads
1.8M
decreased by-18.1%
Maintainers
1
Install size
2.35 MB
Created
Weekly downloads
 

Package description

What is swiper?

The swiper npm package is a modern touch slider with hardware accelerated transitions. It is intended for use in mobile websites, mobile web apps, and mobile native/hybrid apps. Swiper is designed to be used in a mobile environment, where touch interactions are fundamental. It provides a number of features like swiping, multiple slides per view, vertical slides, and more.

What are swiper's main functionalities?

Basic Swiper

This code initializes a basic Swiper instance with horizontal direction, loop mode, pagination, navigation arrows, and a scrollbar.

import Swiper from 'swiper';

const swiper = new Swiper('.swiper-container', {
  // Optional parameters
  direction: 'horizontal',
  loop: true,

  // If we need pagination
  pagination: {
    el: '.swiper-pagination',
  },

  // Navigation arrows
  navigation: {
    nextEl: '.swiper-button-next',
    prevEl: '.swiper-button-prev',
  },

  // And if we need scrollbar
  scrollbar: {
    el: '.swiper-scrollbar',
  },
});

Multiple Slides Per View

This code sets up a Swiper instance where you can have multiple slides visible at the same time, with space between the slides and clickable pagination.

import Swiper from 'swiper';

const swiper = new Swiper('.swiper-container', {
  slidesPerView: 3,
  spaceBetween: 30,
  pagination: {
    el: '.swiper-pagination',
    clickable: true,
  },
});

Vertical Swiper

This code snippet demonstrates how to initialize a Swiper instance that allows vertical swiping with clickable pagination.

import Swiper from 'swiper';

const swiper = new Swiper('.swiper-container', {
  direction: 'vertical',
  pagination: {
    el: '.swiper-pagination',
    clickable: true,
  },
});

Other packages similar to swiper

Changelog

Source

4.5.1 - Released on September 13th, 2019

  • Core
    • Fixed issue when callbacks fires on init even if it disabled (#2807)
    • Fixed issue when "swiper-slide-visible" class name in some situations shows up when it shouldn't
    • slidesPerColumnFill: 'row' now considers groups (#3077)
  • Thumbs
    • Fixes bug 'Cannot read property indexOf of undefined' that sometimes occurs on use of thumbnails
  • Keyboard
    • Added PageUp/PageDown keybindings.
  • Autoplay
    • Fixed issue when window resize stopped autoplay
  • Parallax
    • Fixed issue when parallax opacity didn't work (#3147)
  • Minor fixes and improvements

Readme

Source

Join the chat at https://gitter.im/nolimits4web/Swiper Build Status devDependency Status jsDelivr Hits

Swiper

Greenkeeper badge

Swiper - is the free and most modern mobile touch slider with hardware accelerated transitions and amazing native behavior. It is intended to be used in mobile websites, mobile web apps, and mobile native/hybrid apps. Designed mostly for iOS, but also works great on latest Android, Windows Phone 8 and modern Desktop browsers.

Swiper is not compatible with all platforms, it is a modern touch slider which is focused only on modern apps/platforms to bring the best experience and simplicity.

Getting Started

Dist / Build

On production use files (JS and CSS) only from dist/ folder, there will be the most stable versions, build/ folder is only for development purpose.

Development Build

Swiper uses gulp to build a development (build) and production (dist) versions.

First you need to have gulp-cli which you should install globally.

$ npm install --global gulp

Then install all dependencies, in repo's root:

$ npm install

And build development version of Swiper:

$ npm run build:dev

The result is available in build/ folder.

Production Build

$ npm run build:prod

Production version will available in dist/ folder.

Contributing

All changes should be committed to src/ files only. Before you open an issue please review the contributing guideline.

Swiper 3.x

If you are still using Swiper 3.x.x, you may find it in Swiper3 Branch

Swiper 2.x

If you are still using Swiper 2.x.x or you need old browsers support, you may find it in Swiper2 Branch

Keywords

FAQs

Last updated on 13 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc