Swiper - v12.0.3
    Preparing search index...

    Interface SwiperOptions

    interface SwiperOptions {
        _emitClasses?: boolean;
        a11y?: A11yOptions;
        allowSlideNext?: boolean;
        allowSlidePrev?: boolean;
        allowTouchMove?: boolean;
        autoHeight?: boolean;
        autoplay?: boolean | AutoplayOptions;
        breakpoints?: {
            [width: number]: SwiperOptions;
            [ratio: string]: SwiperOptions;
        };
        breakpointsBase?: "container"
        | CSSSelector
        | "window";
        cardsEffect?: CardsEffectOptions;
        centeredSlides?: boolean;
        centeredSlidesBounds?: boolean;
        centerInsufficientSlides?: boolean;
        containerModifierClass?: string;
        controller?: ControllerOptions;
        coverflowEffect?: CoverflowEffectOptions;
        createElements?: boolean;
        creativeEffect?: CreativeEffectOptions;
        cssMode?: boolean;
        cubeEffect?: CubeEffectOptions;
        direction?: "horizontal" | "vertical";
        edgeSwipeDetection?: string | boolean;
        edgeSwipeThreshold?: number;
        effect?:
            | "slide"
            | "fade"
            | "cube"
            | "coverflow"
            | "flip"
            | "creative"
            | "cards"
            | string & {};
        enabled?: boolean;
        eventsPrefix?: string;
        fadeEffect?: FadeEffectOptions;
        flipEffect?: FlipEffectOptions;
        focusableElements?: string;
        followFinger?: boolean;
        freeMode?: boolean
        | FreeModeOptions;
        grabCursor?: boolean;
        grid?: GridOptions;
        hashNavigation?: boolean | HashNavigationOptions;
        height?: number | null;
        history?: boolean | HistoryOptions;
        init?: boolean;
        initialSlide?: number;
        injectStyles?: string[];
        injectStylesUrls?: string[];
        keyboard?: boolean | KeyboardOptions;
        lazyPreloaderClass?: string;
        lazyPreloadPrevNext?: number;
        longSwipes?: boolean;
        longSwipesMs?: number;
        longSwipesRatio?: number;
        loop?: boolean;
        loopAddBlankSlides?: boolean;
        loopAdditionalSlides?: number;
        loopPreventsSliding?: boolean;
        maxBackfaceHiddenSlides?: number;
        modules?: SwiperModule[];
        mousewheel?: boolean | MousewheelOptions;
        navigation?: boolean | NavigationOptions;
        nested?: boolean;
        normalizeSlideIndex?: boolean;
        noSwiping?: boolean;
        noSwipingClass?: string;
        noSwipingSelector?: string;
        observeParents?: boolean;
        observer?: boolean;
        observeSlideChildren?: boolean;
        on?: {
            _beforeBreakpoint?: (
                swiper: SwiperClass,
                breakpointParams: SwiperOptions,
            ) => void;
            _containerClasses?: (swiper: SwiperClass, classNames: string) => void;
            _freeModeNoMomentumRelease?: (swiper: SwiperClass) => void;
            _slideClass?: (
                swiper: SwiperClass,
                slideEl: HTMLElement,
                classNames: string,
            ) => void;
            _slideClasses?: (
                swiper: SwiperClass,
                slides: { classNames: string; index: number; slideEl: HTMLElement }[],
            ) => void;
            _swiper?: (swiper: SwiperClass) => void;
            activeIndexChange?: (swiper: SwiperClass) => void;
            afterInit?: (swiper: SwiperClass) => void;
            autoplay?: (swiper: SwiperClass) => void;
            autoplayPause?: (swiper: SwiperClass) => void;
            autoplayResume?: (swiper: SwiperClass) => void;
            autoplayStart?: (swiper: SwiperClass) => void;
            autoplayStop?: (swiper: SwiperClass) => void;
            autoplayTimeLeft?: (
                swiper: SwiperClass,
                timeLeft: number,
                percentage: number,
            ) => void;
            beforeDestroy?: (swiper: SwiperClass) => void;
            beforeInit?: (swiper: SwiperClass) => void;
            beforeLoopFix?: (swiper: SwiperClass) => void;
            beforeResize?: (swiper: SwiperClass) => void;
            beforeSlideChangeStart?: (swiper: SwiperClass) => void;
            beforeTransitionStart?: (
                swiper: SwiperClass,
                speed: number,
                internal: any,
            ) => void;
            breakpoint?: (
                swiper: SwiperClass,
                breakpointParams: SwiperOptions,
            ) => void;
            changeDirection?: (swiper: SwiperClass) => void;
            click?: (
                swiper: SwiperClass,
                event: MouseEvent | TouchEvent | PointerEvent,
            ) => void;
            destroy?: (swiper: SwiperClass) => void;
            doubleClick?: (
                swiper: SwiperClass,
                event: MouseEvent | TouchEvent | PointerEvent,
            ) => void;
            doubleTap?: (
                swiper: SwiperClass,
                event: MouseEvent | TouchEvent | PointerEvent,
            ) => void;
            fromEdge?: (swiper: SwiperClass) => void;
            hashChange?: (swiper: SwiperClass) => void;
            hashSet?: (swiper: SwiperClass) => void;
            init?: (swiper: SwiperClass) => any;
            keyPress?: (swiper: SwiperClass, keyCode: string) => void;
            lock?: (swiper: SwiperClass) => void;
            loopFix?: (swiper: SwiperClass) => void;
            momentumBounce?: (swiper: SwiperClass) => void;
            navigationHide?: (swiper: SwiperClass) => void;
            navigationNext?: (swiper: SwiperClass) => void;
            navigationPrev?: (swiper: SwiperClass) => void;
            navigationShow?: (swiper: SwiperClass) => void;
            observerUpdate?: (swiper: SwiperClass) => void;
            orientationchange?: (swiper: SwiperClass) => void;
            paginationHide?: (swiper: SwiperClass) => void;
            paginationRender?: (
                swiper: SwiperClass,
                paginationEl: HTMLElement,
            ) => void;
            paginationShow?: (swiper: SwiperClass) => void;
            paginationUpdate?: (
                swiper: SwiperClass,
                paginationEl: HTMLElement,
            ) => void;
            progress?: (swiper: SwiperClass, progress: number) => void;
            reachBeginning?: (swiper: SwiperClass) => void;
            reachEnd?: (swiper: SwiperClass) => void;
            realIndexChange?: (swiper: SwiperClass) => void;
            resize?: (swiper: SwiperClass) => void;
            scroll?: (swiper: SwiperClass, event: WheelEvent) => void;
            scrollbarDragEnd?: (
                swiper: SwiperClass,
                event: MouseEvent | TouchEvent | PointerEvent,
            ) => void;
            scrollbarDragMove?: (
                swiper: SwiperClass,
                event: MouseEvent | TouchEvent | PointerEvent,
            ) => void;
            scrollbarDragStart?: (
                swiper: SwiperClass,
                event: MouseEvent | TouchEvent | PointerEvent,
            ) => void;
            setTransition?: (swiper: SwiperClass, transition: number) => void;
            setTranslate?: (swiper: SwiperClass, translate: number) => void;
            slideChange?: (swiper: SwiperClass) => void;
            slideChangeTransitionEnd?: (swiper: SwiperClass) => void;
            slideChangeTransitionStart?: (swiper: SwiperClass) => void;
            slideNextTransitionEnd?: (swiper: SwiperClass) => void;
            slideNextTransitionStart?: (swiper: SwiperClass) => void;
            slidePrevTransitionEnd?: (swiper: SwiperClass) => void;
            slidePrevTransitionStart?: (swiper: SwiperClass) => void;
            slideResetTransitionEnd?: (swiper: SwiperClass) => void;
            slideResetTransitionStart?: (swiper: SwiperClass) => void;
            sliderFirstMove?: (swiper: SwiperClass, event: TouchEvent) => void;
            sliderMove?: (
                swiper: SwiperClass,
                event: MouseEvent | TouchEvent | PointerEvent,
            ) => void;
            slidesGridLengthChange?: (swiper: SwiperClass) => void;
            slidesLengthChange?: (swiper: SwiperClass) => void;
            slidesUpdated?: (swiper: SwiperClass) => void;
            snapGridLengthChange?: (swiper: SwiperClass) => void;
            snapIndexChange?: (swiper: SwiperClass) => void;
            tap?: (
                swiper: SwiperClass,
                event: MouseEvent | TouchEvent | PointerEvent,
            ) => void;
            toEdge?: (swiper: SwiperClass) => void;
            touchEnd?: (
                swiper: SwiperClass,
                event: MouseEvent | TouchEvent | PointerEvent,
            ) => void;
            touchMove?: (
                swiper: SwiperClass,
                event: MouseEvent | TouchEvent | PointerEvent,
            ) => void;
            touchMoveOpposite?: (
                swiper: SwiperClass,
                event: MouseEvent | TouchEvent | PointerEvent,
            ) => void;
            touchStart?: (
                swiper: SwiperClass,
                event: MouseEvent | TouchEvent | PointerEvent,
            ) => void;
            transitionEnd?: (swiper: SwiperClass) => void;
            transitionStart?: (swiper: SwiperClass) => void;
            unlock?: (swiper: SwiperClass) => void;
            update?: (swiper: SwiperClass) => void;
            zoomChange?: (
                swiper: SwiperClass,
                scale: number,
                imageEl: HTMLElement,
                slideEl: HTMLElement,
            ) => void;
        };
        oneWayMovement?: boolean;
        pagination?: boolean
        | PaginationOptions;
        parallax?: boolean | ParallaxOptions;
        passiveListeners?: boolean;
        preventClicks?: boolean;
        preventClicksPropagation?: boolean;
        preventInteractionOnTransition?: boolean;
        resistance?: boolean;
        resistanceRatio?: number;
        resizeObserver?: boolean;
        rewind?: boolean;
        roundLengths?: boolean;
        runCallbacksOnInit?: boolean;
        scrollbar?: boolean | ScrollbarOptions;
        setWrapperSize?: boolean;
        shortSwipes?: boolean;
        simulateTouch?: boolean;
        slideActiveClass?: string;
        slideBlankClass?: string;
        slideClass?: string;
        slideFullyVisibleClass?: string;
        slideNextClass?: string;
        slidePrevClass?: string;
        slidesOffsetAfter?: number;
        slidesOffsetBefore?: number;
        slidesPerGroup?: number;
        slidesPerGroupAuto?: boolean;
        slidesPerGroupSkip?: number;
        slidesPerView?: number | "auto";
        slideToClickedSlide?: boolean;
        slideVisibleClass?: string;
        spaceBetween?: string | number;
        speed?: number;
        swipeHandler?: HTMLElement | CSSSelector | null;
        swiperElementNodeName?: string;
        threshold?: number;
        thumbs?: ThumbsOptions;
        touchAngle?: number;
        touchEventsTarget?: "container" | "wrapper";
        touchMoveStopPropagation?: boolean;
        touchRatio?: number;
        touchReleaseOnEdges?: boolean;
        touchStartForcePreventDefault?: boolean;
        touchStartPreventDefault?: boolean;
        uniqueNavElements?: boolean;
        updateOnWindowResize?: boolean;
        url?: string | null;
        userAgent?: string | null;
        virtual?: boolean | VirtualOptions<any>;
        virtualTranslate?: boolean;
        watchOverflow?: boolean;
        watchSlidesProgress?: boolean;
        width?: number | null;
        wrapperClass?: string;
        zoom?: boolean | ZoomOptions;
        onAny?(handler: (eventName: string, ...args: any[]) => void): void;
    }
    Index

    Properties

    _emitClasses? a11y? allowSlideNext? allowSlidePrev? allowTouchMove? autoHeight? autoplay? breakpoints? breakpointsBase? cardsEffect? centeredSlides? centeredSlidesBounds? centerInsufficientSlides? containerModifierClass? controller? coverflowEffect? createElements? creativeEffect? cssMode? cubeEffect? direction? edgeSwipeDetection? edgeSwipeThreshold? effect? enabled? eventsPrefix? fadeEffect? flipEffect? focusableElements? followFinger? freeMode? grabCursor? grid? hashNavigation? height? history? init? initialSlide? injectStyles? injectStylesUrls? keyboard? lazyPreloaderClass? lazyPreloadPrevNext? longSwipes? longSwipesMs? longSwipesRatio? loop? loopAddBlankSlides? loopAdditionalSlides? loopPreventsSliding? maxBackfaceHiddenSlides? modules? mousewheel? navigation? nested? normalizeSlideIndex? noSwiping? noSwipingClass? noSwipingSelector? observeParents? observer? observeSlideChildren? on? oneWayMovement? pagination? parallax? passiveListeners? preventClicks? preventClicksPropagation? preventInteractionOnTransition? resistance? resistanceRatio? resizeObserver? rewind? roundLengths? runCallbacksOnInit? scrollbar? setWrapperSize? shortSwipes? simulateTouch? slideActiveClass? slideBlankClass? slideClass? slideFullyVisibleClass? slideNextClass? slidePrevClass? slidesOffsetAfter? slidesOffsetBefore? slidesPerGroup? slidesPerGroupAuto? slidesPerGroupSkip? slidesPerView? slideToClickedSlide? slideVisibleClass? spaceBetween? speed? swipeHandler? swiperElementNodeName? threshold? thumbs? touchAngle? touchEventsTarget? touchMoveStopPropagation? touchRatio? touchReleaseOnEdges? touchStartForcePreventDefault? touchStartPreventDefault? uniqueNavElements? updateOnWindowResize? url? userAgent? virtual? virtualTranslate? watchOverflow? watchSlidesProgress? width? wrapperClass? zoom?

    Methods

    Properties

    _emitClasses?: boolean

    !INTERNAL When enabled will emit "_containerClasses" and "_slideClass" events

    Object with a11y parameters or boolean true to enable with default settings.

    const swiper = new Swiper('.swiper', {
    a11y: {
    prevSlideMessage: 'Previous slide',
    nextSlideMessage: 'Next slide',
    },
    });
    allowSlideNext?: boolean

    Set to false to disable swiping to next slide direction (to right or bottom)

    true
    
    allowSlidePrev?: boolean

    Set to false to disable swiping to previous slide direction (to left or top)

    true
    
    allowTouchMove?: boolean

    If false, then the only way to switch the slide is use of external API functions like slidePrev or slideNext

    true
    
    autoHeight?: boolean

    Set to true and slider wrapper will adapt its height to the height of the currently active slide

    false
    
    autoplay?: boolean | AutoplayOptions

    Object with autoplay parameters or boolean true to enable with default settings

    const swiper = new Swiper('.swiper', {
    autoplay: {
    delay: 5000,
    },
    });
    breakpoints?: { [width: number]: SwiperOptions; [ratio: string]: SwiperOptions }

    Allows to set different parameter for different responsive breakpoints (screen sizes). Not all parameters can be changed in breakpoints, only those which do not require different layout and logic, like slidesPerView, slidesPerGroup, spaceBetween, grid.rows. Such parameters like loop and effect won't work

    const swiper = new Swiper('.swiper', {
    // Default parameters
    slidesPerView: 1,
    spaceBetween: 10,
    // Responsive breakpoints
    breakpoints: {
    // when window width is >= 320px
    320: {
    slidesPerView: 2,
    spaceBetween: 20
    },
    // when window width is >= 480px
    480: {
    slidesPerView: 3,
    spaceBetween: 30
    },
    // when window width is >= 640px
    640: {
    slidesPerView: 4,
    spaceBetween: 40
    }
    }
    })
    const swiper = new Swiper('.swiper', {
    slidesPerView: 1,
    spaceBetween: 10,
    // using "ratio" endpoints
    breakpoints: {
    '@0.75': {
    slidesPerView: 2,
    spaceBetween: 20,
    },
    '@1.00': {
    slidesPerView: 3,
    spaceBetween: 40,
    },
    '@1.50': {
    slidesPerView: 4,
    spaceBetween: 50,
    },
    }
    });
    breakpointsBase?: "container" | CSSSelector | "window"

    Base for breakpoints (beta). Can be window or container. If set to window (by default) then breakpoint keys mean window width. If set to container then breakpoint keys treated as swiper container width

    'window'
    
    cardsEffect?: CardsEffectOptions

    Object with Cards-effect parameters

    const swiper = new Swiper('.swiper', {
    effect: 'cards',
    cardsEffect: {
    // ...
    },
    });
    centeredSlides?: boolean

    If true, then active slide will be centered, not always on the left side.

    false
    
    centeredSlidesBounds?: boolean

    If true, then active slide will be centered without adding gaps at the beginning and end of slider. Required centeredSlides: true. Not intended to be used with loop or pagination

    false
    
    centerInsufficientSlides?: boolean

    When enabled it center slides if the amount of slides less than slidesPerView. Not intended to be used loop mode and grid.rows

    false
    
    containerModifierClass?: string

    The beginning of the modifier CSS class that can be added to swiper container depending on different parameters

    'swiper-'
    
    controller?: ControllerOptions

    Object with controller parameters or boolean true to enable with default settings

    const swiper = new Swiper('.swiper', {
    controller: {
    inverse: true,
    },
    });
    coverflowEffect?: CoverflowEffectOptions

    Object with Coverflow-effect parameters.

    const swiper = new Swiper('.swiper', {
    effect: 'coverflow',
    coverflowEffect: {
    rotate: 30,
    slideShadows: false,
    },
    });
    createElements?: boolean

    When enabled Swiper will automatically wrap slides with swiper-wrapper element, and will create required elements for navigation, pagination and scrollbar they are enabled (with their respective params object or with boolean true))

    false
    
    creativeEffect?: CreativeEffectOptions

    Object with Creative-effect parameters

    const swiper = new Swiper('.swiper', {
    effect: 'creative',
    creativeEffect: {
    prev: {
    // will set `translateZ(-400px)` on previous slides
    translate: [0, 0, -400],
    },
    next: {
    // will set `translateX(100%)` on next slides
    translate: ['100%', 0, 0],
    },
    },
    });
    cssMode?: boolean

    When enabled it will use modern CSS Scroll Snap API. It doesn't support all of Swiper's features, but potentially should bring a much better performance in simple configurations.

    This is what is not supported when it is enabled:

    • Cube effect
    • speed parameter may not have no effect
    • All transition start/end related events (use slideChange instead)
    • slidesPerGroup has limited support
    • simulateTouch doesn't have effect and "dragging" with mouse doesn't work
    • resistance doesn't have any effect
    • allowSlidePrev/Next
    • swipeHandler

    In case if you use it with other effects, especially 3D effects, it is required to wrap slide's content with <div class="swiper-slide-transform"> element. And if you use any custom styles on slides (like background colors, border radius, border, etc.), they should be set on swiper-slide-transform element instead.

    <div class="swiper">
    <div class="swiper-wrapper">
    <div class="swiper-slide">
    <!-- wrap slide content with transform element -->
    <div class="swiper-slide-transform">
    ... slide content ...
    </div>
    </div>
    ...
    </div>
    </div>
    <script>
    const swiper = new Swiper('.swiper', {
    effect: 'flip',
    cssMode: true,
    });
    </script>
    false
    
    cubeEffect?: CubeEffectOptions

    Object with Cube-effect parameters

    const swiper = new Swiper('.swiper', {
    effect: 'cube',
    cubeEffect: {
    slideShadows: false,
    },
    });
    direction?: "horizontal" | "vertical"

    Can be 'horizontal' or 'vertical' (for vertical slider).

    'horizontal'
    
    edgeSwipeDetection?: string | boolean

    Enable to release Swiper events for swipe-back work in app. If set to 'prevent' then it will prevent system swipe-back navigation instead. This feature works only with "touch" events (and not pointer events), so it will work on iOS/Android devices and won't work on Windows devices with pointer (touch) events.

    false
    
    edgeSwipeThreshold?: number

    Area (in px) from left edge of the screen to release touch events for swipe-back in app

    20
    
    effect?:
        | "slide"
        | "fade"
        | "cube"
        | "coverflow"
        | "flip"
        | "creative"
        | "cards"
        | string & {}

    Transition effect. Can be 'slide', 'fade', 'cube', 'coverflow', 'flip', 'creative' or 'cards'

    'slide'
    
    enabled?: boolean

    Whether Swiper initially enabled. When Swiper is disabled, it will hide all navigation elements and won't respond to any events and interactions

    true
    
    eventsPrefix?: string

    Event name prefix for all DOM events emitted by Swiper Element (web component)

    swiper

    fadeEffect?: FadeEffectOptions

    Object with Fade-effect parameters

    const swiper = new Swiper('.swiper', {
    effect: 'fade',
    fadeEffect: {
    crossFade: true
    },
    });
    flipEffect?: FlipEffectOptions

    Object with Flip-effect parameters

    const swiper = new Swiper('.swiper', {
    effect: 'flip',
    flipEffect: {
    slideShadows: false,
    },
    });
    focusableElements?: string

    CSS selector for focusable elements. Swiping will be disabled on such elements if they are "focused"

    'input, select, option, textarea, button, video, label'
    
    followFinger?: boolean

    If disabled, then slider will be animated only when you release it, it will not move while you hold your finger on it

    true
    
    freeMode?: boolean | FreeModeOptions

    Enables free mode functionality. Object with free mode parameters or boolean true to enable with default settings.

    const swiper = new Swiper('.swiper', {
    freeMode: true,
    });

    const swiper = new Swiper('.swiper', {
    freeMode: {
    enabled: true,
    sticky: true,
    },
    });
    grabCursor?: boolean

    This option may a little improve desktop usability. If true, user will see the "grab" cursor when hover on Swiper

    false
    

    Object with grid parameters to enable "multirow" slider.

    const swiper = new Swiper('.swiper', {
    grid: {
    rows: 2,
    },
    });
    hashNavigation?: boolean | HashNavigationOptions

    Enables hash url navigation to for slides. Object with hash navigation parameters or boolean true to enable with default settings

    const swiper = new Swiper('.swiper', {
    hashNavigation: {
    replaceState: true,
    },
    });
    height?: number | null

    Swiper height (in px). Parameter allows to force Swiper height. Useful only if you initialize Swiper when it is hidden and in SSR and Test environments for correct Swiper initialization

    null
    

    Setting this parameter will make Swiper not responsive

    history?: boolean | HistoryOptions

    Enables history push state where every slide will have its own url. In this parameter you have to specify main slides url like "slides" and specify every slide url using data-history attribute.

    Object with history navigation parameters or boolean true to enable with default settings

    const swiper = new Swiper('.swiper', {
    history: {
    replaceState: true,
    },
    });
    <!-- will produce "slides/slide1" url in browser history -->
    <div class="swiper-slide" data-history="slide1"></div>
    init?: boolean

    Whether Swiper should be initialised automatically when you create an instance. If disabled, then you need to init it manually by calling swiper.init()

    true
    
    initialSlide?: number

    Index number of initial slide.

    0
    
    injectStyles?: string[]

    Inject text styles to the shadow DOM. Only for usage with Swiper Element

    injectStylesUrls?: string[]

    Inject styles <link>s to the shadow DOM. Only for usage with Swiper Element

    keyboard?: boolean | KeyboardOptions

    Enables navigation through slides using keyboard. Object with keyboard parameters or boolean true to enable with default settings

    const swiper = new Swiper('.swiper', {
    keyboard: {
    enabled: true,
    onlyInViewport: false,
    },
    });
    lazyPreloaderClass?: string

    CSS class name of lazy preloader

    'swiper-lazy-preloader'
    
    lazyPreloadPrevNext?: number

    Number of next and previous slides to preload. Only applicable if using lazy loading.

    0
    
    longSwipes?: boolean

    Set to false if you want to disable long swipes

    true
    
    longSwipesMs?: number

    Minimal duration (in ms) to trigger swipe to next/previous slide during long swipes

    300
    
    longSwipesRatio?: number

    Ratio to trigger swipe to next/previous slide during long swipes

    0.5
    
    loop?: boolean

    Set to true to enable continuous loop mode

    Because of nature of how the loop mode works (it will rearrange slides), total number of slides must be:

    • more than or equal to slidesPerView + slidesPerGroup
    • even to slidesPerGroup (or use loopAddBlankSlides parameter)
    • even to grid.rows (or use loopAddBlankSlides parameter)
    false
    
    loopAddBlankSlides?: boolean

    Automatically adds blank slides if you use Grid or slidesPerGroup and the total amount of slides is not even to slidesPerGroup or to grid.rows

    true
    
    loopAdditionalSlides?: number

    Allows to increase amount of looped slides

    0
    
    loopPreventsSliding?: boolean

    If enabled then slideNext/Prev will do nothing while slider is animating in loop mode

    true
    
    maxBackfaceHiddenSlides?: number

    If total number of slides less than specified here value, then Swiper will enable backface-visibility: hidden on slide elements to reduce visual "flicker" in Safari.

    It is not recommended to enable it on large amount of slides as it will reduce performance

    10
    
    modules?: SwiperModule[]

    Array with Swiper modules

    import Swiper from 'swiper';
    import { Navigation, Pagination } from 'swiper/modules';

    const swiper = new Swiper('.swiper', {
    modules: [ Navigation, Pagination ],
    });
    mousewheel?: boolean | MousewheelOptions

    Enables navigation through slides using mouse wheel. Object with mousewheel parameters or boolean true to enable with default settings

    const swiper = new Swiper('.swiper', {
    mousewheel: {
    invert: true,
    },
    });
    navigation?: boolean | NavigationOptions

    Object with navigation parameters or boolean true to enable with default settings.

    const swiper = new Swiper('.swiper', {
    navigation: {
    nextEl: '.swiper-button-next',
    prevEl: '.swiper-button-prev',
    },
    });
    nested?: boolean

    Set to true on Swiper for correct touch events interception. Use only on swipers that use same direction as the parent one

    false
    
    normalizeSlideIndex?: boolean

    Normalize slide index.

    true
    
    noSwiping?: boolean

    Enable/disable swiping on elements matched to class specified in noSwipingClass

    true
    
    noSwipingClass?: string

    Specify noSwiping's element css class

    'swiper-no-swiping'
    
    noSwipingSelector?: string

    Can be used instead of noSwipingClass to specify elements to disable swiping on. For example 'input' will disable swiping on all inputs

    
    
    observeParents?: boolean

    Set to true if you also need to watch Mutations for Swiper parent elements

    false
    
    observer?: boolean

    Set to true to enable Mutation Observer on Swiper and its elements. In this case Swiper will be updated (reinitialized) each time if you change its style (like hide/show) or modify its child elements (like adding/removing slides)

    false
    
    observeSlideChildren?: boolean

    Set to true if you also need to watch Mutations for Swiper slide children elements

    false
    
    on?: {
        _beforeBreakpoint?: (
            swiper: SwiperClass,
            breakpointParams: SwiperOptions,
        ) => void;
        _containerClasses?: (swiper: SwiperClass, classNames: string) => void;
        _freeModeNoMomentumRelease?: (swiper: SwiperClass) => void;
        _slideClass?: (
            swiper: SwiperClass,
            slideEl: HTMLElement,
            classNames: string,
        ) => void;
        _slideClasses?: (
            swiper: SwiperClass,
            slides: { classNames: string; index: number; slideEl: HTMLElement }[],
        ) => void;
        _swiper?: (swiper: SwiperClass) => void;
        activeIndexChange?: (swiper: SwiperClass) => void;
        afterInit?: (swiper: SwiperClass) => void;
        autoplay?: (swiper: SwiperClass) => void;
        autoplayPause?: (swiper: SwiperClass) => void;
        autoplayResume?: (swiper: SwiperClass) => void;
        autoplayStart?: (swiper: SwiperClass) => void;
        autoplayStop?: (swiper: SwiperClass) => void;
        autoplayTimeLeft?: (
            swiper: SwiperClass,
            timeLeft: number,
            percentage: number,
        ) => void;
        beforeDestroy?: (swiper: SwiperClass) => void;
        beforeInit?: (swiper: SwiperClass) => void;
        beforeLoopFix?: (swiper: SwiperClass) => void;
        beforeResize?: (swiper: SwiperClass) => void;
        beforeSlideChangeStart?: (swiper: SwiperClass) => void;
        beforeTransitionStart?: (
            swiper: SwiperClass,
            speed: number,
            internal: any,
        ) => void;
        breakpoint?: (swiper: SwiperClass, breakpointParams: SwiperOptions) => void;
        changeDirection?: (swiper: SwiperClass) => void;
        click?: (
            swiper: SwiperClass,
            event: MouseEvent | TouchEvent | PointerEvent,
        ) => void;
        destroy?: (swiper: SwiperClass) => void;
        doubleClick?: (
            swiper: SwiperClass,
            event: MouseEvent | TouchEvent | PointerEvent,
        ) => void;
        doubleTap?: (
            swiper: SwiperClass,
            event: MouseEvent | TouchEvent | PointerEvent,
        ) => void;
        fromEdge?: (swiper: SwiperClass) => void;
        hashChange?: (swiper: SwiperClass) => void;
        hashSet?: (swiper: SwiperClass) => void;
        init?: (swiper: SwiperClass) => any;
        keyPress?: (swiper: SwiperClass, keyCode: string) => void;
        lock?: (swiper: SwiperClass) => void;
        loopFix?: (swiper: SwiperClass) => void;
        momentumBounce?: (swiper: SwiperClass) => void;
        navigationHide?: (swiper: SwiperClass) => void;
        navigationNext?: (swiper: SwiperClass) => void;
        navigationPrev?: (swiper: SwiperClass) => void;
        navigationShow?: (swiper: SwiperClass) => void;
        observerUpdate?: (swiper: SwiperClass) => void;
        orientationchange?: (swiper: SwiperClass) => void;
        paginationHide?: (swiper: SwiperClass) => void;
        paginationRender?: (swiper: SwiperClass, paginationEl: HTMLElement) => void;
        paginationShow?: (swiper: SwiperClass) => void;
        paginationUpdate?: (swiper: SwiperClass, paginationEl: HTMLElement) => void;
        progress?: (swiper: SwiperClass, progress: number) => void;
        reachBeginning?: (swiper: SwiperClass) => void;
        reachEnd?: (swiper: SwiperClass) => void;
        realIndexChange?: (swiper: SwiperClass) => void;
        resize?: (swiper: SwiperClass) => void;
        scroll?: (swiper: SwiperClass, event: WheelEvent) => void;
        scrollbarDragEnd?: (
            swiper: SwiperClass,
            event: MouseEvent | TouchEvent | PointerEvent,
        ) => void;
        scrollbarDragMove?: (
            swiper: SwiperClass,
            event: MouseEvent | TouchEvent | PointerEvent,
        ) => void;
        scrollbarDragStart?: (
            swiper: SwiperClass,
            event: MouseEvent | TouchEvent | PointerEvent,
        ) => void;
        setTransition?: (swiper: SwiperClass, transition: number) => void;
        setTranslate?: (swiper: SwiperClass, translate: number) => void;
        slideChange?: (swiper: SwiperClass) => void;
        slideChangeTransitionEnd?: (swiper: SwiperClass) => void;
        slideChangeTransitionStart?: (swiper: SwiperClass) => void;
        slideNextTransitionEnd?: (swiper: SwiperClass) => void;
        slideNextTransitionStart?: (swiper: SwiperClass) => void;
        slidePrevTransitionEnd?: (swiper: SwiperClass) => void;
        slidePrevTransitionStart?: (swiper: SwiperClass) => void;
        slideResetTransitionEnd?: (swiper: SwiperClass) => void;
        slideResetTransitionStart?: (swiper: SwiperClass) => void;
        sliderFirstMove?: (swiper: SwiperClass, event: TouchEvent) => void;
        sliderMove?: (
            swiper: SwiperClass,
            event: MouseEvent | TouchEvent | PointerEvent,
        ) => void;
        slidesGridLengthChange?: (swiper: SwiperClass) => void;
        slidesLengthChange?: (swiper: SwiperClass) => void;
        slidesUpdated?: (swiper: SwiperClass) => void;
        snapGridLengthChange?: (swiper: SwiperClass) => void;
        snapIndexChange?: (swiper: SwiperClass) => void;
        tap?: (
            swiper: SwiperClass,
            event: MouseEvent | TouchEvent | PointerEvent,
        ) => void;
        toEdge?: (swiper: SwiperClass) => void;
        touchEnd?: (
            swiper: SwiperClass,
            event: MouseEvent | TouchEvent | PointerEvent,
        ) => void;
        touchMove?: (
            swiper: SwiperClass,
            event: MouseEvent | TouchEvent | PointerEvent,
        ) => void;
        touchMoveOpposite?: (
            swiper: SwiperClass,
            event: MouseEvent | TouchEvent | PointerEvent,
        ) => void;
        touchStart?: (
            swiper: SwiperClass,
            event: MouseEvent | TouchEvent | PointerEvent,
        ) => void;
        transitionEnd?: (swiper: SwiperClass) => void;
        transitionStart?: (swiper: SwiperClass) => void;
        unlock?: (swiper: SwiperClass) => void;
        update?: (swiper: SwiperClass) => void;
        zoomChange?: (
            swiper: SwiperClass,
            scale: number,
            imageEl: HTMLElement,
            slideEl: HTMLElement,
        ) => void;
    }

    Register event handlers

    Type Declaration

    • Optional_beforeBreakpoint?: (swiper: SwiperClass, breakpointParams: SwiperOptions) => void

      !INTERNAL: Event will fired right before breakpoint change

    • Optional_containerClasses?: (swiper: SwiperClass, classNames: string) => void

      !INTERNAL: Event will fired after setting CSS classes on swiper container element

    • Optional_freeModeNoMomentumRelease?: (swiper: SwiperClass) => void

      !INTERNAL: Event will be fired on free mode touch end (release) and there will no be momentum

    • Optional_slideClass?: (swiper: SwiperClass, slideEl: HTMLElement, classNames: string) => void

      !INTERNAL: Event will fired after setting CSS classes on swiper slide element

    • Optional_slideClasses?: (
          swiper: SwiperClass,
          slides: { classNames: string; index: number; slideEl: HTMLElement }[],
      ) => void

      !INTERNAL: Event will fired after setting CSS classes on all swiper slides

    • Optional_swiper?: (swiper: SwiperClass) => void

      !INTERNAL: Event will fired as soon as swiper instance available (before init)

    • OptionalactiveIndexChange?: (swiper: SwiperClass) => void

      Event will fired on active index change

    • OptionalafterInit?: (swiper: SwiperClass) => void

      Event will fired right after initialization

    • Optionalautoplay?: (swiper: SwiperClass) => void

      Event will be fired when slide changed with autoplay

    • OptionalautoplayPause?: (swiper: SwiperClass) => void

      Event will be fired on autoplay pause

    • OptionalautoplayResume?: (swiper: SwiperClass) => void

      Event will be fired on autoplay resume

    • OptionalautoplayStart?: (swiper: SwiperClass) => void

      Event will be fired in when autoplay started

    • OptionalautoplayStop?: (swiper: SwiperClass) => void

      Event will be fired when autoplay stopped

    • OptionalautoplayTimeLeft?: (swiper: SwiperClass, timeLeft: number, percentage: number) => void

      Event triggers continuously while autoplay is enabled. It contains time left (in ms) before transition to next slide and percentage of that time related to autoplay delay

    • OptionalbeforeDestroy?: (swiper: SwiperClass) => void

      Event will be fired right before Swiper destroyed

    • OptionalbeforeInit?: (swiper: SwiperClass) => void

      Event will fired right before initialization

    • OptionalbeforeLoopFix?: (swiper: SwiperClass) => void

      Event will be fired right before "loop fix"

    • OptionalbeforeResize?: (swiper: SwiperClass) => void

      Event will fired before resize handler

    • OptionalbeforeSlideChangeStart?: (swiper: SwiperClass) => void

      Event will fired before slide change transition start

    • OptionalbeforeTransitionStart?: (swiper: SwiperClass, speed: number, internal: any) => void

      Event will fired before transition start

    • Optionalbreakpoint?: (swiper: SwiperClass, breakpointParams: SwiperOptions) => void

      Event will be fired on breakpoint change

    • OptionalchangeDirection?: (swiper: SwiperClass) => void

      Event will fired on direction change

    • Optionalclick?: (swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent) => void

      Event will be fired when user click/tap on Swiper. Receives pointerup event as an arguments.

    • Optionaldestroy?: (swiper: SwiperClass) => void

      Event will be fired on swiper destroy

    • OptionaldoubleClick?: (swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent) => void

      Event will be fired when user double click/tap on Swiper

    • OptionaldoubleTap?: (swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent) => void

      Event will be fired when user double tap on Swiper's container. Receives pointerup event as an arguments

    • OptionalfromEdge?: (swiper: SwiperClass) => void

      Event will be fired when Swiper goes from beginning or end position

    • OptionalhashChange?: (swiper: SwiperClass) => void

      Event will be fired on window hash change

    • OptionalhashSet?: (swiper: SwiperClass) => void

      Event will be fired when swiper updates the hash

    • Optionalinit?: (swiper: SwiperClass) => any

      Fired right after Swiper initialization.

      Note that with swiper.on('init') syntax it will work only in case you set init: false parameter.

      const swiper = new Swiper('.swiper', {
      init: false,
      // other parameters
      });
      swiper.on('init', function() {
      // do something
      });
      // init Swiper
      swiper.init();
      // Otherwise use it as the parameter:
      const swiper = new Swiper('.swiper', {
      // other parameters
      on: {
      init: function () {
      // do something
      },
      }
      });
    • OptionalkeyPress?: (swiper: SwiperClass, keyCode: string) => void

      Event will be fired on key press

    • Optionallock?: (swiper: SwiperClass) => void

      Event will be fired when swiper is locked (when watchOverflow enabled)

    • OptionalloopFix?: (swiper: SwiperClass) => void

      Event will be fired after "loop fix"

    • OptionalmomentumBounce?: (swiper: SwiperClass) => void

      Event will be fired on momentum bounce

    • OptionalnavigationHide?: (swiper: SwiperClass) => void

      Event will be fired on navigation hide

    • OptionalnavigationNext?: (swiper: SwiperClass) => void

      Event will be fired on navigation next button click

    • OptionalnavigationPrev?: (swiper: SwiperClass) => void

      Event will be fired on navigation prev button click

    • OptionalnavigationShow?: (swiper: SwiperClass) => void

      Event will be fired on navigation show

    • OptionalobserverUpdate?: (swiper: SwiperClass) => void

      Event will be fired if observer is enabled and it detects DOM mutations

    • Optionalorientationchange?: (swiper: SwiperClass) => void

      Event will be fired on orientation change (e.g. landscape -> portrait)

    • OptionalpaginationHide?: (swiper: SwiperClass) => void

      Event will be fired on pagination hide

    • OptionalpaginationRender?: (swiper: SwiperClass, paginationEl: HTMLElement) => void

      Event will be fired after pagination rendered

    • OptionalpaginationShow?: (swiper: SwiperClass) => void

      Event will be fired on pagination show

    • OptionalpaginationUpdate?: (swiper: SwiperClass, paginationEl: HTMLElement) => void

      Event will be fired when pagination updated

    • Optionalprogress?: (swiper: SwiperClass, progress: number) => void

      Event will be fired when Swiper progress is changed, as an arguments it receives progress that is always from 0 to 1

    • OptionalreachBeginning?: (swiper: SwiperClass) => void

      Event will be fired when Swiper reach its beginning (initial position)

    • OptionalreachEnd?: (swiper: SwiperClass) => void

      Event will be fired when Swiper reach last slide

    • OptionalrealIndexChange?: (swiper: SwiperClass) => void

      Event will fired on real index change

    • Optionalresize?: (swiper: SwiperClass) => void

      Event will be fired on window resize right before swiper's onresize manipulation

    • Optionalscroll?: (swiper: SwiperClass, event: WheelEvent) => void

      Event will be fired on mousewheel scroll

    • OptionalscrollbarDragEnd?: (swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent) => void

      Event will be fired on draggable scrollbar drag end

    • OptionalscrollbarDragMove?: (swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent) => void

      Event will be fired on draggable scrollbar drag move

    • OptionalscrollbarDragStart?: (swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent) => void

      Event will be fired on draggable scrollbar drag start

    • OptionalsetTransition?: (swiper: SwiperClass, transition: number) => void

      Event will be fired everytime when swiper starts animation. Receives current transition duration (in ms) as an arguments

    • OptionalsetTranslate?: (swiper: SwiperClass, translate: number) => void

      Event will be fired when swiper's wrapper change its position. Receives current translate value as an arguments

    • OptionalslideChange?: (swiper: SwiperClass) => void

      Event will be fired when currently active slide is changed

    • OptionalslideChangeTransitionEnd?: (swiper: SwiperClass) => void

      Event will be fired after animation to other slide (next or previous).

    • OptionalslideChangeTransitionStart?: (swiper: SwiperClass) => void

      Event will be fired in the beginning of animation to other slide (next or previous).

    • OptionalslideNextTransitionEnd?: (swiper: SwiperClass) => void

      Same as "slideChangeTransitionEnd" but for "forward" direction only

    • OptionalslideNextTransitionStart?: (swiper: SwiperClass) => void

      Same as "slideChangeTransitionStart" but for "forward" direction only

    • OptionalslidePrevTransitionEnd?: (swiper: SwiperClass) => void

      Same as "slideChangeTransitionEnd" but for "backward" direction only

    • OptionalslidePrevTransitionStart?: (swiper: SwiperClass) => void

      Same as "slideChangeTransitionStart" but for "backward" direction only

    • OptionalslideResetTransitionEnd?: (swiper: SwiperClass) => void

      Event will be fired in the end of animation of resetting slide to current one

    • OptionalslideResetTransitionStart?: (swiper: SwiperClass) => void

      Event will be fired in the beginning of animation of resetting slide to current one

    • OptionalsliderFirstMove?: (swiper: SwiperClass, event: TouchEvent) => void

      Event will be fired with first touch/drag move

    • OptionalsliderMove?: (swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent) => void

      Event will be fired when user touch and move finger over Swiper and move it. Receives pointermove event as an arguments.

    • OptionalslidesGridLengthChange?: (swiper: SwiperClass) => void

      Event will be fired when slides grid has changed

    • OptionalslidesLengthChange?: (swiper: SwiperClass) => void

      Event will be fired when number of slides has changed

    • OptionalslidesUpdated?: (swiper: SwiperClass) => void

      Event will be fired after slides and their sizes are calculated and updated

    • OptionalsnapGridLengthChange?: (swiper: SwiperClass) => void

      Event will be fired when snap grid has changed

    • OptionalsnapIndexChange?: (swiper: SwiperClass) => void

      Event will fired on snap index change

    • Optionaltap?: (swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent) => void

      Event will be fired when user click/tap on Swiper. Receives pointerup event as an arguments.

    • OptionaltoEdge?: (swiper: SwiperClass) => void

      Event will be fired when Swiper goes to beginning or end position

    • OptionaltouchEnd?: (swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent) => void

      Event will be fired when user release Swiper. Receives pointerup event as an arguments.

    • OptionaltouchMove?: (swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent) => void

      Event will be fired when user touch and move finger over Swiper. Receives pointermove event as an arguments.

    • OptionaltouchMoveOpposite?: (swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent) => void

      Event will be fired when user touch and move finger over Swiper in direction opposite to direction parameter. Receives pointermove event as an arguments.

    • OptionaltouchStart?: (swiper: SwiperClass, event: MouseEvent | TouchEvent | PointerEvent) => void

      Event will be fired when user touch Swiper. Receives pointerdown event as an arguments.

    • OptionaltransitionEnd?: (swiper: SwiperClass) => void

      Event will be fired after transition.

    • OptionaltransitionStart?: (swiper: SwiperClass) => void

      Event will be fired in the beginning of transition.

    • Optionalunlock?: (swiper: SwiperClass) => void

      Event will be fired when swiper is unlocked (when watchOverflow enabled)

    • Optionalupdate?: (swiper: SwiperClass) => void

      Event will be fired after swiper.update() call

    • OptionalzoomChange?: (
          swiper: SwiperClass,
          scale: number,
          imageEl: HTMLElement,
          slideEl: HTMLElement,
      ) => void

      Event will be fired on zoom change

    oneWayMovement?: boolean

    When enabled, will swipe slides only forward (one-way) regardless of swipe direction

    false
    
    pagination?: boolean | PaginationOptions

    Object with pagination parameters or boolean true to enable with default settings.

    const swiper = new Swiper('.swiper', {
    pagination: {
    el: '.swiper-pagination',
    type: 'bullets',
    },
    });
    parallax?: boolean | ParallaxOptions

    Object with parallax parameters or boolean true to enable with default settings.

    const swiper = new Swiper('.swiper', {
    parallax: true,
    });
    passiveListeners?: boolean

    Passive event listeners will be used by default where possible to improve scrolling performance on mobile devices. But if you need to use e.preventDefault and you have conflict with it, then you should disable this parameter

    true
    
    preventClicks?: boolean

    Set to true to prevent accidental unwanted clicks on links during swiping

    true
    
    preventClicksPropagation?: boolean

    Set to true to stop clicks event propagation on links during swiping

    true
    
    preventInteractionOnTransition?: boolean

    When enabled it won't allow to change slides by swiping or navigation/pagination buttons during transition

    false
    
    resistance?: boolean

    Set to false if you want to disable resistant bounds

    true
    
    resistanceRatio?: number

    This option allows you to control resistance ratio

    0.85
    
    resizeObserver?: boolean

    When enabled it will use ResizeObserver (if supported by browser) on swiper container to detect container resize (instead of watching for window resize)

    true
    
    rewind?: boolean

    Set to true to enable "rewind" mode. When enabled, clicking "next" navigation button (or calling .slideNext()) when on last slide will slide back to the first slide. Clicking "prev" navigation button (or calling .slidePrev()) when on first slide will slide forward to the last slide.

    false
    

    Should not be used together with loop mode

    roundLengths?: boolean

    Set to true to round values of slides width and height to prevent blurry texts on usual resolution screens (if you have such)

    false
    
    runCallbacksOnInit?: boolean

    Fire Transition/SlideChange/Start/End events on swiper initialization. Such events will be fired on initialization in case of your initialSlide is not 0, or you use loop mode

    true
    
    scrollbar?: boolean | ScrollbarOptions

    Object with scrollbar parameters or boolean true to enable with default settings.

    const swiper = new Swiper('.swiper', {
    scrollbar: {
    el: '.swiper-scrollbar',
    draggable: true,
    },
    });
    setWrapperSize?: boolean

    Enabled this option and plugin will set width/height on swiper wrapper equal to total size of all slides. Mostly should be used as compatibility fallback option for browser that don't support flexbox layout well

    false
    
    shortSwipes?: boolean

    Set to false if you want to disable short swipes

    true
    
    simulateTouch?: boolean

    If true, Swiper will accept mouse events like touch events (click and drag to change slides)

    true
    
    slideActiveClass?: string

    CSS class name of currently active slide

    'swiper-slide-active'
    

    By changing classes you will also need to change Swiper's CSS to reflect changed classes

    Not supported in Swiper React/Vue components

    slideBlankClass?: string

    CSS class name of the blank slide added by the loop mode (when loopAddBlankSlides is enabled)

    'swiper-slide-blank'
    

    Not supported in Swiper React/Vue

    slideClass?: string

    CSS class name of slide

    'swiper-slide'
    

    By changing classes you will also need to change Swiper's CSS to reflect changed classes

    Not supported in Swiper React/Vue components

    slideFullyVisibleClass?: string

    CSS class name of fully (when whole slide is in the viewport) visible slide

    'swiper-slide-fully-visible'
    

    Not supported in Swiper React/Vue

    slideNextClass?: string

    CSS class name of slide which is right after currently active slide

    'swiper-slide-next'
    

    By changing classes you will also need to change Swiper's CSS to reflect changed classes

    Not supported in Swiper React/Vue

    slidePrevClass?: string

    CSS class name of slide which is right before currently active slide

    'swiper-slide-prev'
    

    By changing classes you will also need to change Swiper's CSS to reflect changed classes

    Not supported in Swiper React/Vue

    slidesOffsetAfter?: number

    Add (in px) additional slide offset in the end of the container (after all slides)

    0
    
    slidesOffsetBefore?: number

    Add (in px) additional slide offset in the beginning of the container (before all slides)

    0
    
    slidesPerGroup?: number

    Set numbers of slides to define and enable group sliding. Useful to use with slidesPerView > 1

    1
    
    slidesPerGroupAuto?: boolean

    This param intended to be used only with slidesPerView: 'auto' and slidesPerGroup: 1. When enabled, it will skip all slides in view on .slideNext() & .slidePrev() methods calls, on Navigation "buttons" clicks and in autoplay.

    false
    
    slidesPerGroupSkip?: number

    The parameter works in the following way: If slidesPerGroupSkip equals 0 (default), no slides are excluded from grouping, and the resulting behaviour is the same as without this change.

    If slidesPerGroupSkip is equal or greater than 1 the first X slides are treated as single groups, whereas all following slides are grouped by the slidesPerGroup value.

    0
    
    slidesPerView?: number | "auto"

    Number of slides per view (slides visible at the same time on slider's container).

    slidesPerView: 'auto' is currently not compatible with multirow mode, when grid.rows > 1

    1
    
    slideToClickedSlide?: boolean

    Set to true and click on any slide will produce transition to this slide

    false
    
    slideVisibleClass?: string

    CSS class name of currently/partially visible slide

    'swiper-slide-visible'
    

    By changing classes you will also need to change Swiper's CSS to reflect changed classes

    Not supported in Swiper React/Vue

    spaceBetween?: string | number

    Distance between slides in px.

    0
    

    If you use "margin" css property to the elements which go into Swiper in which you pass "spaceBetween" into, navigation might not work properly.

    speed?: number

    Duration of transition between slides (in ms)

    300
    
    swipeHandler?: HTMLElement | CSSSelector | null

    String with CSS selector or HTML element of the container with pagination that will work as only available handler for swiping

    null
    
    swiperElementNodeName?: string

    The name of the swiper element node name; used for detecting web component rendering

    'SWIPER-CONTAINER'
    
    threshold?: number

    Threshold value in px. If "touch distance" will be lower than this value then swiper will not move

    5
    
    thumbs?: ThumbsOptions

    Object with thumbs component parameters

    const swiper = new Swiper('.swiper', {
    ...
    thumbs: {
    swiper: thumbsSwiper
    }
    });
    touchAngle?: number

    Allowable angle (in degrees) to trigger touch move

    45
    
    touchEventsTarget?: "container" | "wrapper"

    Target element to listen touch events on. Can be 'container' (to listen for touch events on swiper) or 'wrapper' (to listen for touch events on swiper-wrapper)

    'wrapper'
    
    touchMoveStopPropagation?: boolean

    If enabled, then propagation of "touchmove" will be stopped

    false
    
    touchRatio?: number

    Touch ratio

    1
    
    touchReleaseOnEdges?: boolean

    Enable to release touch events on slider edge position (beginning, end) to allow for further page scrolling. This feature works only with "touch" events (and not pointer events), so it will work on iOS/Android devices and won't work on Windows devices with pointer events. Also threshold parameter must be set to 0

    false
    
    touchStartForcePreventDefault?: boolean

    Force to always prevent default for touchstart (pointerdown) event

    false
    
    touchStartPreventDefault?: boolean

    If disabled, pointerdown event won't be prevented

    true
    
    uniqueNavElements?: boolean

    If enabled (by default) and navigation elements' parameters passed as a string (like ".pagination") then Swiper will look for such elements through child elements first. Applies for pagination, prev/next buttons and scrollbar elements

    true
    
    updateOnWindowResize?: boolean

    Swiper will recalculate slides position on window resize (orientationchange)

    true
    
    url?: string | null

    Required for active slide detection when rendered on server-side and enabled history

    null
    
    userAgent?: string | null

    userAgent string. Required for browser/device detection when rendered on server-side

    null
    
    virtual?: boolean | VirtualOptions<any>

    Enables virtual slides functionality. Object with virtual slides parameters or boolean true to enable with default settings.

    const swiper = new Swiper('.swiper', {
    virtual: {
    slides: ['Slide 1', 'Slide 2', 'Slide 3', 'Slide 4', 'Slide 5'],
    },
    });
    virtualTranslate?: boolean

    Enabled this option and swiper will be operated as usual except it will not move, real translate values on wrapper will not be set. Useful when you may need to create custom slide transition

    false
    
    watchOverflow?: boolean

    When enabled Swiper will be disabled and hide navigation buttons on case there are not enough slides for sliding.

    true
    
    watchSlidesProgress?: boolean

    Enable this feature to calculate each slides progress and visibility (slides in viewport will have additional visible class)

    false
    
    width?: number | null

    Swiper width (in px). Parameter allows to force Swiper width. Useful only if you initialize Swiper when it is hidden and in SSR and Test environments for correct Swiper initialization

    null
    

    Setting this parameter will make Swiper not responsive

    wrapperClass?: string

    CSS class name of slides' wrapper

    'swiper-wrapper'
    

    By changing classes you will also need to change Swiper's CSS to reflect changed classes

    Not supported in Swiper React/Vue

    zoom?: boolean | ZoomOptions

    Enables zooming functionality. Object with zoom parameters or boolean true to enable with default settings

    const swiper = new Swiper('.swiper', {
    zoom: {
    maxRatio: 5,
    },
    });

    Methods

    • Add event listener that will be fired on all events

      Parameters

      • handler: (eventName: string, ...args: any[]) => void

      Returns void

      const swiper = new Swiper('.swiper', {
      onAny(eventName, ...args) {
      console.log('Event: ', eventName);
      console.log('Event data: ', args);
      }
      });