Professional Documents
Culture Documents
Installation
There are few options on how to include/import Swiper into your project:
// import Swiper JS
import Swiper from 'swiper';
// import Swiper styles
import 'swiper/swiper-bundle.css';
By default Swiper exports only core version without additional modules (like Navigation, Pagination,
etc.). So you need to import and configure them too:
// init Swiper:
const swiper = new Swiper(...);
If you want to import Swiper with all modules (bundle) then it should be imported
from swiper/bundle :
https://swiperjs.com/get-started 1/4
5/5/2021 Getting Started With Swiper
// init Swiper:
const swiper = new Swiper(...);
<script src="https://unpkg.com/swiper/swiper-bundle.js"></script>
<script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script>
If you use ES modules in browser, there is a CDN version for that too:
<script type="module">
import Swiper from 'https://unpkg.com/swiper/swiper-bundle.esm.browser.min.js'
Download assets
If you want to use Swiper assets locally, you can directly download them
from https://unpkg.com/swiper/
https://swiperjs.com/get-started 2/4
5/5/2021 Getting Started With Swiper
...
</div>
<!-- If we need pagination -->
<div class="swiper-pagination"></div>
.swiper-container {
width: 600px;
height: 300px;
}
Initialize Swiper
Finally, we need to initialize Swiper in JS:
// If we need pagination
pagination: {
el: '.swiper-pagination',
},
// Navigation arrows
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
https://swiperjs.com/get-started 3/4
5/5/2021 Getting Started With Swiper
},
What next?
As you see it is really easy to integrate Swiper into your website or app. So here are your next steps:
Go to API Documentation to learn more about all Swiper API and how to control it.
Look at available Demos.
If you have questions about Swiper ask them in StackOverflow and don't forget to tag your
question with swiper tag.
Create issue on GitHub if you found a bug.
https://swiperjs.com/get-started 4/4