Swiper v6.0.0 Release Notes
Release Date: 2020-05-26 // almost 4 years ago-
๐ New NPM package structure
- All scripts transpiled to ES5
- New and renamed files (BREAKING CHANGE):
swiper.less
- core Swiper LESSswiper.scss
- core Swiper SCSSswiper-bundle.css
- Swiper bundle CSSswiper-bundle.js
- Swiper bundle JavaScript in UMD formatswiper-bundle.cjs.js
- Swiper bundle JavaScript in CommonJS formatswiper-bundle.esm.js
- Swiper bundle JavaScript in ESM formatswiper.cjs.js
- Swiper core JavaScript in CommonJS formatswiper.esm.js
- Swiper core JavaScript in ESM format- Following imports are now available
import Swiper from 'swiper'
- imports core versionimport Swiper from 'swiper/bundle'
- imports bundle versionimport Swiper from 'swiper/core'
- imports core version- Components can be imported from core version using named imports, or using direct import:
import { Navigation } from 'swiper'; // or import Navigation from 'swiper/components/navigation'; // and styles (Less or SCSS only) import 'swiper/components/navigation/navigation.less';
๐ Full server-side rendering support (SSR) with new parameters:
userAgent
- device user agent, required for some initial detectionurl
- required to correctly detect and set initial slide if Hash Navigation or History modules are used
๐ New
loopPreventsSlide
boolean parameter (by default enabled), that prevents slidePrev/Next transitions while transition is in progress๐ Full support for Node.js DOM libraries like JSDOM and Domino
โ Added new
onAny(callback)
listener to listen for any swiper event๐ฅ All events now emit
swiper
instance as a first argument (BREAKING CHANGE)โ Added official TypeScript definitions
โก๏ธ Updated to use next generation
dom7
andssr-window
librariesAll new Swiper React components:
import { Swiper, SwiperSlide } from 'swiper/react'; export default () => { return ( <Swiper spaceBetween={50} slidesPerView={3} onSwiper={(swiper) => console.log(swiper)} onSlideChange={() => console.log('slide change')} > <SwiperSlide>Slide 1</SwiperSlide> <SwiperSlide>Slide 2</SwiperSlide> ... </Swiper> ); };