Convert Figma logo to code with AI

nolimits4web logoswiper

Most modern mobile touch slider with hardware accelerated transitions

39,523
9,747
39,523
137

Top Related Projects

28,370

the last carousel you'll ever need

7,271

A dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more

4,828

Splide is a lightweight, flexible and accessible slider/carousel written in TypeScript. No dependencies, no Lighthouse errors.

A lightweight carousel library with fluid motion and great swipe precision.

Quick Overview

Swiper is a modern, mobile-friendly JavaScript slider library with hardware-accelerated transitions and amazing native behavior. It's designed to be used in mobile websites, mobile web apps, and mobile native/hybrid apps. Swiper is free and open-source.

Pros

  • Highly customizable with numerous options and API methods
  • Smooth, hardware-accelerated transitions for optimal performance
  • Responsive and touch-friendly, works well on both mobile and desktop devices
  • Active development and community support

Cons

  • Can be overkill for simple slider needs
  • Learning curve for advanced customizations
  • Potential performance issues if not optimized properly
  • Dependency on external library may increase overall project size

Code Examples

  1. Basic Swiper initialization:
const swiper = new Swiper('.swiper', {
  slidesPerView: 3,
  spaceBetween: 30,
  pagination: {
    el: '.swiper-pagination',
    clickable: true,
  },
});
  1. Swiper with navigation buttons:
const swiper = new Swiper('.swiper', {
  navigation: {
    nextEl: '.swiper-button-next',
    prevEl: '.swiper-button-prev',
  },
});
  1. Responsive breakpoints:
const swiper = new Swiper('.swiper', {
  slidesPerView: 1,
  spaceBetween: 10,
  breakpoints: {
    640: {
      slidesPerView: 2,
      spaceBetween: 20,
    },
    768: {
      slidesPerView: 4,
      spaceBetween: 40,
    },
  },
});

Getting Started

  1. Install Swiper via npm:

    npm install swiper
    
  2. Import Swiper and its styles in your JavaScript file:

    import Swiper from 'swiper';
    import 'swiper/css';
    
  3. Add Swiper HTML layout to your page:

    <div class="swiper">
      <div class="swiper-wrapper">
        <div class="swiper-slide">Slide 1</div>
        <div class="swiper-slide">Slide 2</div>
        <div class="swiper-slide">Slide 3</div>
      </div>
      <div class="swiper-pagination"></div>
    </div>
    
  4. Initialize Swiper:

    const swiper = new Swiper('.swiper', {
      pagination: {
        el: '.swiper-pagination',
      },
    });
    

Competitor Comparisons

28,370

the last carousel you'll ever need

Pros of Slick

  • Lightweight and simple to use, with minimal setup required
  • Extensive browser support, including older versions of Internet Explorer
  • Responsive design with built-in breakpoints for different screen sizes

Cons of Slick

  • Less feature-rich compared to Swiper, with fewer advanced options
  • Not as actively maintained, with fewer updates and bug fixes
  • Limited touch support and mobile optimization compared to Swiper

Code Comparison

Slick initialization:

$('.slider').slick({
  slidesToShow: 3,
  slidesToScroll: 1,
  autoplay: true,
  autoplaySpeed: 2000,
});

Swiper initialization:

const swiper = new Swiper('.swiper-container', {
  slidesPerView: 3,
  spaceBetween: 30,
  autoplay: {
    delay: 2000,
  },
});

Both libraries offer similar basic functionality, but Swiper provides more advanced options and better performance for complex use cases. Slick is easier to set up and use for simple slider needs, while Swiper offers more flexibility and features for advanced implementations.

7,271

A dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more

Pros of Glide

  • Lightweight: Glide has a smaller file size, making it more suitable for projects where minimizing load times is crucial.
  • Simpler API: Glide offers a more straightforward and easier-to-use API, which can be beneficial for developers who prefer simplicity.
  • No dependencies: Glide is a standalone library without external dependencies, potentially reducing conflicts in your project.

Cons of Glide

  • Fewer features: Glide has a more limited set of features compared to Swiper's extensive functionality.
  • Less active development: Glide has fewer updates and a smaller community, which may result in slower bug fixes and feature additions.
  • Limited browser support: Glide may not work as well on older browsers compared to Swiper's broader compatibility.

Code Comparison

Glide initialization:

new Glide('.glide').mount()

Swiper initialization:

new Swiper('.swiper-container', {
  direction: 'horizontal',
  loop: true
})

Both libraries offer simple initialization, but Swiper provides more configuration options out of the box. Glide's approach is more minimalistic, while Swiper offers greater flexibility for complex use cases.

4,828

Splide is a lightweight, flexible and accessible slider/carousel written in TypeScript. No dependencies, no Lighthouse errors.

Pros of Splide

  • Lighter weight and faster performance
  • No dependencies, pure JavaScript
  • More flexible and customizable API

Cons of Splide

  • Smaller community and ecosystem compared to Swiper
  • Fewer built-in features and modules

Code Comparison

Splide initialization:

new Splide('.splide', {
  type: 'loop',
  perPage: 3,
  autoplay: true
}).mount();

Swiper initialization:

new Swiper('.swiper', {
  loop: true,
  slidesPerView: 3,
  autoplay: {
    delay: 3000,
  },
});

Both libraries offer similar basic functionality, but Splide's API is generally more concise. Swiper provides more options out of the box, while Splide focuses on core functionality and leaves advanced features to extensions.

Splide's smaller file size and lack of dependencies make it a good choice for projects prioritizing performance and minimalism. Swiper, with its larger community and extensive feature set, may be preferable for complex projects requiring advanced functionality or widespread support.

Ultimately, the choice between Splide and Swiper depends on specific project requirements, desired features, and performance considerations.

A lightweight carousel library with fluid motion and great swipe precision.

Pros of Embla Carousel

  • Lightweight and performant, with a smaller bundle size
  • More flexible and customizable, allowing for advanced layouts
  • Better touch and mouse drag support, especially for mobile devices

Cons of Embla Carousel

  • Less extensive documentation compared to Swiper
  • Fewer built-in features and plugins out of the box
  • Smaller community and ecosystem around the project

Code Comparison

Embla Carousel:

import EmblaCarousel from 'embla-carousel'

const embla = EmblaCarousel(document.querySelector('.embla'), {
  loop: true,
  align: 'center'
})

Swiper:

import Swiper from 'swiper'

const swiper = new Swiper('.swiper-container', {
  loop: true,
  centeredSlides: true
})

Both libraries offer similar basic setup, but Embla Carousel's API is more focused on providing core functionality, while Swiper offers a wider range of options and features by default. Embla Carousel's approach allows for more granular control over the carousel behavior, but may require more custom code for advanced features. Swiper, on the other hand, provides many built-in options that can be easily configured without additional coding.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Get Started | Documentation | Demos

Financial Contributors on Open Collective Build status jsDelivr Hits tree-shakeable types included

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.

Sponsors

casino portugal online Route4Me Route Planner Automatenspieler Best Online Casino Australia Buy Youtube Views 100% Real & Cheap Uudet nettikasinot 2024 » Listaamme Suomen uudet kasinot buy instagram followers from skweezer.net Hit'n'Spin Bonus ohne Einzahlung Best SMM Panel In The World | Crescitaly.com Casino utan Svensk Licens 2023 automatenspielex online Nettikasinot 2022 | Löydä Luotettava & Turvallinen Nettikasino!
NonGamStopOdds casino sites Online Casino Test 2022 » 90+ Casinos von Experten geprüft! Online sports betting and casino at Parimatch India Casinos not on GamStop | Casino-Wise.com Casinos not on GamStop UK 🏆 NonGamStopWager.com Casino utan spelpaus Online Casinos Cyprus - CasinoAuditor Best Online Casinos in Canada Pay Someone to Write My Research Paper TikTok Expert: Buy TikTok Followers Nove Casino eSports at HellaGood Marketing agency
Dotcom-Monitor: Advanced Website Monitoring Solutions CasinosZonderCruksOnline Buy Instagram Likes Buy Tiktok Followers Buy Instagram Followers Buy Instagram Automatic Likes Inclave Casino Buy TikTok Views Famegear — Trace your favorite figure's fame through their gear Honrev — The Most Honest Product Reviews From Real Customer Experiences Buy TikTok Followers Online Casino Nederland
Get Organic TikTok Growth With Real Followers, Likes And Views My Coding Pal Hashtags For Likes Buy Instagram Followers Thunderclapit CreditCaptain – Leading AI Credit Repair Service Buy Google Reviews UK Casinos not on GamStop 2023 - nongamstopcasinos.net Buy TikTok Followers uaeonlinecasino.com Guidebook.BetWinner FitclubFinder CasinoOnlineCA
ZonderCruks - Online Gokken Zonder CRUKS Amazon Return Pallets BloodyCase Crypto Loko Free Chip No Deposit Online Kasyno Polis SMM Panel Services Provider RunLikes Best Bitcoin & Crypto Casino Sites SocialBoss Mejores Casinos Sin Licencia en España 91 Club SANCTIONS LAW FIRM
Interpol Law Firm try bookmakers not on GamStop The Red Playground Buy Instagram Followers & Likes Buy TikTok Likes With Free Trial CasinoRevisor: Alles über die besten Casinos in Deutschland Ai2people Accelerating Your Software Products | Teravision Technologies revistacomunicacion.org Casino Magyar Ta καλύτερα διαδικτυακά καζίνο στην Ελλάδα το 2024 $10 Deposit Casinos
SMM Panel : Best and Cheapest Smm Services in The World! Best sites to Buy Instagram Followers Buy Tiktok Followers Riversweeps Sweepstakes Software Bulkoid instagram profile viewer Gokken Online Cazino zonder Cruks buy youtube views Norska Casino HolyMolyCasinos Danske casino Sitio web con reseñas de los mejores casinos en línea de Chile
EarthWeb fb post likes Buzzoid.pro Bountii Coupons UseViral Buy Instagram Reels views Buitenlandse Online Casinos Greece Casinos Anonypro Chudovo Fortune Tiger Casino Bonussen Nederland
impltech Norsk casinoer på nett Trusted Online Store Review and Latest Coupon Code 2024 Casino No deposit Bonus 2024 Instasocials The best casino reviews, bonuses and slots Vapemaps Quickbooks Tool Hub Anonymous Instagram Story Viewer - Instanavigation Best sites to Buy Instagram Likes Jämför försäkringar Jogo Fortune Rabbit
Buy Instagram Likes - Real Likes & Instant Delivery! Vedonlyonti ilman rekisteroitymista Jogo Tiger Fortune – Jogo do Tigrinho para Ganhar Dinheiro All Bitcoin & Crypto Casino Trace a phone number within minutes Vedonlyontiyhtiot.com - Parhaat Vedolyöntiyhtiöt & Bonukset Purchase TikTok followers, likes and views Buy Youtube Views eBay Arbitrage Software UpGrow: #1 AI-Powered Instagram Growth | Real IG Followers Best Bitcoin Casinos SafeHamsters: The Pinnacle of Crypto Sports - SafeHamsters
buy instagram likes 90+ UK Casinos Not on Gamstop » Non GamStop Sites Topnoaccountcasinos casino zonder registratie Best Real Money Online Gambling Sites 2023 Čеské оnlinе kаsinо rесеnzе а hоdnосеní Utländska Casino | Bästa Casinon med Trustly, BankID & Zimpler Prointernet SVITUA Bruno Casino is a great online casino offering various bonuses for your favourite slot games. Nexus Smoke Premium E-Liquid and Luxury Vape Products Utländska Casino | Bästa Casinon med Trustly, BankID & Zimpler Overlyzer » football betting analyzer & soccer predictions
Founder Shield | Risk Management for High-Growth Companies Buy Instagram Follower & Likes | Dopoid Casino utan Svensk Licens | Bästa Casinon utan Spelpaus 🎖️ Casinomir UK - Your Guide to the World of Online Casinos Casinos Not On Gamstop UK: Where To Play Safely In 2023 Updated October Рayid Сasinos Withdrawal & Deposit in Аustralia - Best РayID Оnline Рokies Detectico Phone Tracker to Find Location by Phone Number AlphaRoot Онлайн казино 777 Україна Игровые автоматы BetFans - Alles over online wedden; Bookmakers Vergelijken Top USA Online Casinos September 2023 | Online United States Casinos
Buy Instagram Reel Views Gamble for Real Money at Honest Casinos - GambleDex Best Online Casino in Philippines using GCash | 2023 Rank Best Online Casinos in New Jersey Best Payout Casinos for Canadian Players Buy YouTube Subscribers & Views UK @ just £1.99 - Boostlikes Buy Twitter Followers – 100% Active & Instant Online Kaszinó Magyar, Legjobb Online Kaszinók 2023 UX Design & Software Development Company Buy Instagram Followers | Real, Instant Delivery & Only $2.97 BairesDev: Promoting Open Source for a Better Future Mines Aposta lll▷ Jogo da Bombinha Que da Dinheiro
siti non AAMS - outlookindia.com Technology, Security, Innovation, The Cyber World Now | Cyberogism Hosting Europe – Super fast support better than AI iGamingMI: Your Trusted Online Gambling Guide In Michigan Property for sale in Spain Scrap Car Removal Toronto | Best Cash For Scrap Cars up to $5,000 Pikakasinot 2023 | Löydä paras uusi pikakasino suomessa! Rahapelit Netissä Toukokuu 2023 - Paras Rahapeli Valikoima Buy Instagram Reels Views Best Online Casino NZ in 2023 - Online Gambling NZ Casinot: Katso mitkä ovat parhaat casinot netissä 2023 Onlinecasinosspelen.com site is dé nummer één gids, waardoor je gemakkelijk alle informatie van de top 10 online casino sites.
Sup! - Standups, Holidays, and Surveys for your team | Sup! Standup Bot Rotativka.com - Най-добрите онлайн казина в България Under 1 Hour Withdrawal Casinos in Australia - 2022 PA Online Casino - List of Best Casinos in Pennsylvania Casino Zonder Registratie 2022 | CZR's Top No Account Casino's Ranglijst Nieuwe Online Casino's December 2022 | Overzicht van de top nieuwe casinos! オンラインカジノ - OnlineCasinoWiki.com cricket betting app Pièces auto neuves au meilleur prix | MISTER AUTO Giochi online e non solo – A quale gioco vuoi giocare oggi? WiserGamblers | Best Online Gambling Guide Coupons, Promo Codes, October 2022 — Refermate
Buy Instagram Likes - Real, Instant Likes - $1/50! - MegaFamous betting sider 🥇 Best Australian Online Pokies. Trusted Online Casino Reviews 2022 Uudet kasinot Elokuu 2022 🥇 - Parhaat uudet nettikasinot The Casino Wizard » Best Casinos & (No) Deposit Bonuses 2022 Take My Online Class For Me? NoNeedToStudy.com Coupontoaster: August 2022 Discount Codes, Coupons, Promo Codes & Deals Fastest Payout Casinos in Canada [2022] Clique Studios - Creative Digital Transformation Buy TikTok Followers - 100% Real & Fast | Just $5.00 - SocialBoosting Rating of best betting sites in Australia Casinos Not on GamStop » Most Trusted Non GamStop UK Casinos ⭐️
Greece Golden Visa Aviator aposta ᐈ Jogo de avião Aviator The Most Popular Stuff On The Internet Buy Instagram views Correct Casinos | The Ultimate Guide to the Legit Online Casinos IB extended essay writing service Online Slots - UK Slot Games - 500 FREE Spins at Wizard Slots Red Dog Online Casino Fortune Games® | Free Spins No Deposit Slot Games | Online Slots LÅN PENGE NU | Hurtige Online lån 2021 | Klik her og Ansøg i dag Erik Kings Zamsino Bonus seiten Review of the best online casino in Italy
VPN for Chrome to Make Web Surfing 100% Safe CasinoExpo casino utan registrering Inkedin - The Online Gambling News Hub Ranking Bukmacherów Legalnych 2020. Bukmacher nr 1 to... The Best Online Casinos in the UK » Gambling Sites by Casinosters Deposit £10 Play with 30, 40, 50, 60, 70, or 80 Pounds✔️ GambLizard Instagram likes Buy 100% Cheap SMM Services - Instagram, YouTube, Twitter

Features

  • Tree-shakeable: Only modules you use will be imported into your app's bundle.
  • Mobile-friendly: It is intended to be used in mobile websites, mobile web apps, and mobile native/hybrid apps.
  • Library Agnostic: Swiper doesn't require any JavaScript libraries like jQuery, which makes Swiper much smaller and faster. It can be safely used with libraries such as jQuery, Zepto, jQuery Mobile, etc.
  • 1:1 Touch movement: By default, Swiper provides 1:1 touch movement interaction, but this ratio can be configured through Swiper settings.
  • Mutation Observer: Swiper has an option to enable Mutation Observer, with this feature Swiper will be automatically reinitialized and recalculate all required parameters if you make dynamic changes to the DOM, or in Swiper styles itself.
  • Rich API: Swiper comes with a very rich API. It allows creating your own pagination, navigation buttons, parallax effects and many more.
  • RTL: Swiper is the only slider that provides 100% RTL support with correct layout.
  • Multi Row Slides Layout: Swiper allows a multiple row slides layout, with a few slides per column.
  • Transition Effects: Fade, Flip, 3D Cube, 3D Coverflow.
  • Two-way Control: Swiper may be used as controller for any number of other Swipers, and even be controlled at the same time.
  • Full Navigation Control: Swiper comes with all required built-in navigation elements, such as Pagination, Navigation arrows and Scrollbar.
  • Flexbox Layout: Swiper uses modern flexbox layout for slides layout, which solves a lot of problems and time with size caclulations. Such layout also allows configuring the Slides grid using pure CSS.
  • Most Flexible Slides Layout Grid: Swiper has a lot of parameters on initialization to make it as flexible as possible. You can control slides per view, per column, per group, space between slides, and many more.
  • Images Lazy Loading: Swiper Lazy Loading delays loading of images in inactive/invisible slides until the user swipes to them. Such feature could make the page load faster and improve Swiper performance.
  • Virtual Slides: Swiper comes with Virtual Slides feature that is great when you have a lot of slides or content-heavy/image-heavy slides so it will keep just the required amount of slides in DOM.
  • Loop mode
  • Autoplay
  • Keyboard control
  • Mousewheel control
  • Nested sliders
  • History navigation
  • Hash navigation
  • Breakpoints configuration
  • Accessibility (A11y)
  • And many more ...

Community

The Swiper community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects

Our Code of Conduct applies to all Swiper community channels.

Dist / Build

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

Development Build

Install all dependencies, in repo's root:


$ npm install

And build development version of Swiper:


$ npm run build

The result is available in dist/ folder.

Running demos:

All demos located in ./playground folder. There you will find Core (HTML, JS), React, Vue versions. To open demo, run:

  • Core: npm run core
  • React: npm run react
  • Vue: npm run vue

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.

Major Roadmapped Features

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

NPM DownloadsLast 30 Days