OptionalonCallbacks: Partial<Get track
Active slide index
Active slide
Get axis name depending on direction
Retrieves the module's callbacks instance.
Detect if can loop
Get container
Container size depending on direction (width or height)
Gets the current track value.
Get events emitter
Get first slide size
If swipe has inertia
Gets the interpolation impulse
Checks if the module has been destroyed.
If the end has been reached
If the scene is idle: not swiping, not interpolating, not transitioning
If track values are interpolating
Check if the active slide is larger than the container and is being scrolled
If the start has been reached
If swipe in progress
If transition in progress
If wheel events are active
Get loop count
Get looped current value
Get maximum track value
Get minimum track value
The name of the module, derived from the class name
Slige magnet origin
Optional prefix for classnames used by the module
Get track progress. From 0 to 1 if not loop. From -Infinity to Infinity if loop
Current properties. Do not mutate these directly, use updateProps instead.
Scrollable slides (which size is larger than the container)
All slides
Gets the target track value.
Protected_addAdds a class name on an element, and keeps track of it for removal when the module is destroyed.
The target DOM element.
The class name to toggle.
Protected_cnHelper function to generate classnames with the module's prefix.
The class names to generate.
A string of class names with the module's prefix applied.
Protected_destroyDestroys the component and clears all timeouts and resources.
Returns the default mutable properties.
Container size. Supported values:
auto detects slide size depending on the container size.number defines the slide size in pixels.px, rem, vw, vh, svh.Sliding direction
Change slide duration
Easing type for timelines
Maximum friction between the final slide and the maximum translation value. From 0 to 1. The higher value the more resistance is applied.
If disabled, then slider will be animated only when you release the finger, it will not move while you hold your finger on it.
If false, disables smooth, continuous scrolling behavior from the mouse wheel
and instead updates the snap position in discrete steps (like pagination).
Enables freemode, with or without sticky magnets.
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
The gap between slides. Supports css units like px, rem, vw, vh, svh.
User will see the "grab" cursor when hovering and "grabbing" when swiping
Interval between automatic slide changes in milliseconds. If null, the interval is disabled.
Direction of automatic slide changes. Can be either 'next' or 'prev'.
Linear interpolation factor for smooth coordinates updates.
Detects if need to loop the progress
Slide magnet origin
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.
When true, swipes shorter than shortSwipeDuration can trigger slide change.
Short swipes work only when followSwipe is true.
Short swipe maximum duration
Minimum distance in pixels to trigger slide change for short swipes
Slides instances. If false, all container's children will be considered as slides.
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.px, rem, vw, vh, svh.Indicates the number of slides to scroll on swipe or wheel.
Snap to the nearest slide on carousel resize
Enable snapping on wheel stop. Works with followWheel enabled.
Snapping threshold for stickOnWheelEnd
Enable or disable swipe events
Swipe axis
Defines if friction is allowed when swiping. Doesn't work with short swipes or when when followSwipe is false
Inertia strength.
Minimum time in milliseconds to trigger swipe move.
Speed factor for swipe movements.
Length in pixels that must be swiped to trigger swipe start.
Enable or disable mouse wheel events for progress control
Wheel axis
Speed factor for mouse wheel movements
Throttle wheel events, value in milliseconds.
Works only if followWheel is disabled.
auto - automatic detection when wheel is enabledReturns the default static properties.
Default active index
HTML container
HTML Element used to emit events
Protected_handleCancel slide transition
Clamp target value between min and max values
Destroys the module, cleaning up resources, callbacks, and event listeners.
Iterate track target value
Loop a coordinate if can loop
Adds a custom callback to the module.
The event type to listen for (e.g., 'props', 'destroy').
The function to execute when the event is triggered.
Additional settings for the callback.
Adds a callback on the module's destruction.
The function to execute during destruction.
Render slides
Request resize (handled with debounce timeout)
Sets track to current & target value instantly
Set track target value
Stick to the nearest magnet
Go to a definite coordinate
Optionaloptions: ISnapTransitionArgGo to a slide by index
Snap/Carousel handler. This class manages sliding progress with options like swipe, wheel interactions, and smooth transitions.
Please not that the class does not apply any styles to the slides, it only handles the logic.
Documentation