CSS Reference ยท Scrolling, Interaction and UI
The scroll-snap-stop property
Reference for the CSS scroll-snap-stop property: force a scroll container to stop at every snap point instead of flying past slides on a fast swipe.
A fast swipe can carry a scroll container past several snap points before it settles. The scroll-snap-stop property, set on a snap child, can forbid that: with always, the container must stop at that element when it is passed during a single scroll gesture.
Use it for sequences where skipping would hurt, like steps in a tutorial or slides that each carry essential information.
.slide { scroll-snap-align: start; scroll-snap-stop: always; }
Try it
Syntax
scroll-snap-stop: normal | always;
- Initial value:
normal - Applies to: all elements (snap areas)
- Inherited: no
- Animatable: no
- Computed value: as specified
Values
| Value | Description |
|---|---|
normal |
The scroll may pass over this snap point if the gesture has enough momentum. |
always |
The container must stop at this snap point; it cannot be passed in one gesture. |
Usage notes
- The effect appears on touch flicks and similar momentum scrolls. Slow scrolling already stops at the nearest point.
- It does nothing without a snap container: the parent needs
scroll-snap-typeand the child needsscroll-snap-align. - Use it sparingly. On a long list,
alwayson every item makes scrolling slow and frustrating, because users must swipe once per item. - It is a better fit for a handful of key checkpoints than for large galleries.
- Keep a visible indicator (dots or step numbers) so people know how many items there are.
Browser support
Supported in current major browsers; older versions ignore it and use normal, so it is safe as an enhancement.
Related
scroll-snap-typeโ enables snappingscroll-snap-alignโ snap positionsoverscroll-behaviorโ scroll chaining- Lesson: Scroll Snap