Interface ISnapMutableProps

Mutable properties for the Snap component

interface ISnapMutableProps {
    __mutableProp?: true;
    centered?: boolean;
    containerSize?: number | string & {} | "auto";
    direction?: "horizontal" | "vertical";
    duration?: TSnapDuration;
    easing?: TEasingType;
    edgeFriction?: number;
    followSwipe?: boolean;
    followWheel?: boolean;
    freemode?: boolean | "sticky";
    friction?: number;
    gap?: string | number;
    grabCursor?: boolean;
    interval?: null | number;
    intervalDirection?: "prev" | "next";
    lerp?: number;
    loop?: boolean;
    origin?: "center" | "start" | "end";
    rewind?: boolean;
    shortSwipes?: boolean;
    shortSwipesDuration?: number;
    shortSwipesThreshold?: number;
    slides?: false | (HTMLElement | SnapSlide)[];
    slideSize?: null | number | string & {} | "auto" | "stretch";
    slidesToScroll?: number;
    stickOnResize?: boolean;
    stickOnWheelEnd?: boolean;
    stickOnWheelEndThreshold?: number;
    swipe?: boolean;
    swipeAxis?: "auto" | "x" | "y" | "angle";
    swipeFriction?: boolean;
    swipeInertiaDuration?: (distance: number) => number;
    swipeInertiaRatio?: number;
    swipeMinTime?: number;
    swipeSpeed?: number;
    swipeThreshold?: number;
    wheel?: boolean;
    wheelAxis?: "auto" | "x" | "y";
    wheelSpeed?: number;
    wheelThrottle?: number | "auto";
}

Hierarchy (View Summary)

Properties

__mutableProp?: true
centered?: boolean

Use origin instead

containerSize?: number | string & {} | "auto"

Container size. Supported values:

  • auto detects slide size depending on the container size.
  • number defines the slide size in pixels.
  • css units like px, rem, vw, vh, svh.
'auto'
direction?: "horizontal" | "vertical"

Sliding direction

'horizontal'
duration?: TSnapDuration

Change slide duration

600
easing?: TEasingType

Easing type for timelines

EaseOutCubic
edgeFriction?: number

Maximum friction between the final slide and the maximum translation value. From 0 to 1. The higher value the more resistance is applied.

0.7
followSwipe?: boolean

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

true
followWheel?: boolean

If false, disables smooth, continuous scrolling behavior from the mouse wheel and instead updates the snap position in discrete steps (like pagination).

true
freemode?: boolean | "sticky"

Enables freemode, with or without sticky magnets.

false
friction?: number

Friction that makes the slides tend to the nearest slide magnet. The value is a number between 0 and 1 which is multiplied by the lerp value. 0 disables friction

0
gap?: string | number

The gap between slides. Supports css units like px, rem, vw, vh, svh.

0
grabCursor?: boolean

User will see the "grab" cursor when hovering and "grabbing" when swiping

false
interval?: null | number

Interval between automatic slide changes in milliseconds. If null, the interval is disabled.

null
intervalDirection?: "prev" | "next"

Direction of automatic slide changes. Can be either 'next' or 'prev'.

'next'
lerp?: number

Linear interpolation factor for smooth coordinates updates.

vevet.mobile ? 1 : 0.3

loop?: boolean

Detects if need to loop the progress

false
origin?: "center" | "start" | "end"

Slide magnet origin

'start'
rewind?: boolean

Enables wrap-around navigation: advancing from the last slide jumps to the first, and going back from the first jumps to the last. Has no effect when loop mode is enabled.

false
shortSwipes?: boolean

When true, swipes shorter than shortSwipeDuration can trigger slide change. Short swipes work only when followSwipe is true.

true
shortSwipesDuration?: number

Short swipe maximum duration

300
shortSwipesThreshold?: number

Minimum distance in pixels to trigger slide change for short swipes

30
slides?: false | (HTMLElement | SnapSlide)[]

Slides instances. If false, all container's children will be considered as slides.

false
slideSize?: null | number | string & {} | "auto" | "stretch"

Slide size. Supported values:

  • auto detects slide size depending on the element or container size.
  • stretch detects slide size as the container size.
  • number defines the slide size in pixels.
  • css units like px, rem, vw, vh, svh.
'auto'
slidesToScroll?: number

Indicates the number of slides to scroll on swipe or wheel.

1
stickOnResize?: boolean

Snap to the nearest slide on carousel resize

true
stickOnWheelEnd?: boolean

Enable snapping on wheel stop. Works with followWheel enabled.

true
stickOnWheelEndThreshold?: number

Snapping threshold for stickOnWheelEnd

30
swipe?: boolean

Enable or disable swipe events

true
swipeAxis?: "auto" | "x" | "y" | "angle"

Swipe axis

'auto'
swipeFriction?: boolean

Defines if friction is allowed when swiping. Doesn't work with short swipes or when when followSwipe is false

false
swipeInertiaDuration?: (distance: number) => number
swipeInertiaRatio?: number

Inertia strength.

1
swipeMinTime?: number

Minimum time in milliseconds to trigger swipe move.

0
swipeSpeed?: number

Speed factor for swipe movements.

1
swipeThreshold?: number

Length in pixels that must be swiped to trigger swipe start.

5
wheel?: boolean

Enable or disable mouse wheel events for progress control

false
wheelAxis?: "auto" | "x" | "y"

Wheel axis

'auto'
wheelSpeed?: number

Speed factor for mouse wheel movements

1
wheelThrottle?: number | "auto"

Throttle wheel events, value in milliseconds. Works only if followWheel is disabled.

  • auto - automatic detection when wheel is enabled
  • `number - value in milliseconds

auto