Swiper

There are few options on how to include/import Swiper into your project:

Install from yarn

We can install Swiper from yarn

yarn add swiper

import swiper in component or file

import Swiper from 'swiper';
import 'swiper/css';

Add the js file on the page you need to use.

<script src="assets/libs/swiper/swiper-bundle.min.js"></script>

Below the example how to use the package and make it working swiper on any page.

HTML

<div class="swiper previewImages" bind:this={swiperContainer} dir="ltr">
    
</div>

JavaScript

let swiperContainer: HTMLDivElement | null = null;
onMount(() => {
    if (swiperContainer) {
        new Swiper(swiperContainer, {
            modules: [Navigation, Pagination, Autoplay],
            loop: true,
            pagination: {
                el: '.swiper-pagination',
                type: 'fraction'
            },
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev'
            },
            autoplay: {
                delay: 2500,
                disableOnInteraction: false
            }
        });
    }
});
Receive the latest updates directly in your inbox!

Be the first to know about new updates and exclusive discounts. No spam, just great offers!

How about

A Custom Project?

With over 7 years of experienced team, we specialize in delivering custom projects for startups, blue-chip companies, and government agencies. We have successfully completed over 250+ projects, providing tailored solutions that meet the unique needs of each client.

Hire Us
Domiex Admin & Dashboards
230+

Total Pages

5+

Layouts

11+

Application

We provide quick support withing one business day to all of our customers.

© Domiex Created & Crafted by SRBThemes.