Swiper is a highly performant, free, and open-source mobile touch slider designed for modern web and hybrid applications. It leverages hardware-accelerated transitions to provide a smooth, native-like user experience. The library is specifically focused on modern platforms and touch devices, thus it is not universally compatible with all browsers or older environments. Swiper is currently at version 12.1.3, indicating active and continuous development with frequent patch and minor releases addressing bugs and introducing new features. Its key differentiators include its focus on touch interactions, modular architecture allowing developers to include only necessary components, and a robust API for extensive customization. It integrates well with various JavaScript frameworks.
npm install swiperVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing Swiper and its modules (Navigation, Pagination, Autoplay), importing necessary CSS, and initializing a basic Swiper instance with common features like loop, autoplay, navigation, and pagination.
Ensure all required modules are imported from `swiper/modules` and passed to `Swiper.use([Module1, Module2])` before initializing Swiper. Update CSS import paths (e.g., `swiper/css`, `swiper/css/navigation`).
Review Swiper's compatibility documentation if targeting specific legacy browsers or non-standard environments. Consider polyfills or alternative libraries if broad legacy support is critical.
Thoroughly test existing Swiper implementations after upgrading to a new major version. Consult the official migration guide for specific details on breaking changes and updated configuration options related to slide positioning and looping.
Utilize framework-specific Swiper components when available. If using vanilla Swiper, ensure proper initialization and destruction within the framework's component lifecycle methods (e.g., `useEffect` for React, `onMounted` and `onUnmounted` for Vue).
Ensure you are using `import { Swiper } from 'swiper';` for ESM and that your build tools correctly handle module resolution. If using CommonJS, verify your bundler's configuration or consider using an older Swiper version with explicit CJS support.Import all necessary modules from `swiper/modules` and pass them in an array to the `modules` option during Swiper initialization: `new Swiper('.swiper', { modules: [Navigation, Pagination] });`.Verify that `import 'swiper/css';` and `import 'swiper/css/navigation';` (and other specific module CSS) are included in your entry file. Also, ensure your HTML contains the correct elements (e.g., `<div class="swiper-button-next"></div>`) within or adjacent to the Swiper container, as specified by Swiper's documentation.
No dependency data recorded yet.