valnub / swiper-autoplay

A quick demo which shows how to use the autoplay feature in Swiper React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swiper React Autoplay Demo

Just a quick demo how to use autoplay feature in Swiper React.

How to run

$ npm install
$ npm run build && npm start

In a nutshell

Assuming you already have your swiper up and running, add this to turn on autoplay:

Add imports

import { Autoplay } from 'swiper';
import 'swiper/css/autoplay';

Create jsx

<Swiper
  modules={[Autoplay]}
  autoplay={{ delay: 1000 }}
  // Alternative with 3sec default timeout:
  // autoplay={true}
>
  {/* Add slides here */}
</Swiper>

About

A quick demo which shows how to use the autoplay feature in Swiper React

License:MIT License


Languages

Language:JavaScript 56.8%Language:HTML 24.8%Language:CSS 18.4%