Socket
Socket
Sign inDemoInstall

swiper

Package Overview
Dependencies
7
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
2.1M
decreased by-0.9%
Maintainers
1
Install size
4.87 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

6.5.0 (2021-03-05)

Bug Fixes

  • a11y: space should trigger role button (3d4039b)
  • core: correctly update slideIndex when other elements are present in slides wrapper (21e7713)
  • core: don't toggle zoom during transition (16f185e), closes #4259
  • core: don't try to move slider when it is locked (51fd048), closes #4284
  • e2e: initSwiper (9915f8b)
  • lazy: fixed issue with lazy loading when freeMode stops without momentum (82bcc5c), closes #4274 #4275
  • navigation: don't hide navigation on pagination click (7b7cccf), closes #4285
  • pagination: don't hide pagination on navigation click (68b8a93), closes #4285
  • svelte: fix Svelte cjs exports (478289c), closes #4297

Features

  • components: added "resizeObserver" boolean option/prop to enable ResizeObserver (f03ffbb), closes #4244
  • core: added support to use ResizeObserver with new "resizeObserver" parameter (5f80052), closes #4244
  • core: possible to enable breakpoints based on container width (instead of window width) (42db86d), closes #4244
  • init cypress (6159524)

Readme

Source

Swiper

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.

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

Keywords

FAQs

Last updated on 05 Mar 2021

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