Movement Types
The moveType option controls panel movement and snap behavior. Three modes are available: snap, freeScroll, and strict.
- JavaScript
- React
- Vue@3
Summary
Key Options
| Option | Type | Default | Description |
|---|---|---|---|
moveType | "snap" | "freeScroll" | "strict" | object | "snap" | Movement behavior mode |
Comparison by Value
| Value | Behavior | Suitable For |
|---|---|---|
"snap" | Snaps by panel unit. Can skip multiple panels depending on drag distance | General carousels, image galleries |
"freeScroll" | Free scrolling without snapping. Inertia applied | Horizontal scroll lists, tab bars |
"strict" | Moves exactly one panel at a time | Onboarding, step-by-step guides, fullscreen sliders |
Details
"snap" in Detail
This is the default. After dragging, it snaps to the nearest panel when released. Multiple panels can be skipped depending on drag speed and distance.
snap with count: You can limit the number of panels to move at once.
moveType: { type: "snap", count: 2 } // Move up to 2 panels at a time
"freeScroll" in Detail
Moves freely like native scrolling without snapping to panels. Inertia based on drag speed is applied. The current panel index is determined by the panel closest to the center of the screen.
stopAtEdge option: Sets whether to stop at the boundary.
moveType: ["freeScroll", { stopAtEdge: true }]
"strict" in Detail
Moves exactly one panel per flick. No matter how fast you drag, only one panel moves at a time. Use when you need to prevent users from skipping content.
Related Options
- Relationship with bound: In freeScroll mode, it is recommended to use
bound: truetogether. Otherwise, it may scroll beyond the boundaries. - Relationship with threshold:
thresholdis the minimum drag distance required for panel transition. Particularly important instrictmode. - Relationship with duration: Controls the duration of the snap animation.
Use Cases
- "snap": General carousels, image galleries, product sliders
- "freeScroll": Horizontal scroll menus, tab bars, tag lists, UI that needs a native scroll feel
- "strict": Onboarding screens, tutorials, step-by-step guides, preventing content skipping
Notes
freeScroll mode scrolls beyond boundaries by default. Set bound: true together to restrict the boundaries.
strict mode restricts user freedom. Use only when sequential navigation is required, such as onboarding.
Related Links
Related Options
bound: Boundary restriction (recommended with freeScroll)threshold: Minimum drag distance for panel transitionduration: Animation duration