Build carousels, full-page scrollers, and sliders — zero JavaScript.
Toggle axis, strictness, and alignment — the demo and generated code update live. Drag to scroll inside the preview.
mandatory always snaps to the next snap point — the scroll never rests between items. Best for carousels and full-page layouts where every slide should be fully visible.
proximity only snaps if you're already near a snap point — the scroll can rest freely between items. Best for long articles and galleries where users may want to read mid-section.
These are the actual use cases. Scroll inside each demo — all pure CSS, zero JavaScript.
Dots sync via scrollsnapchange event (Chrome 129+/Safari 18.2+) — replaces IntersectionObserver hacks on supported browsers.
scroll-snap-align: center on each avatar — clicking an avatar centers it. scroll-padding ensures edge avatars are reachable.
Replaces JavaScript libraries like fullPage.js for simple landing pages. Use proximity on content-heavy pages to avoid trapping readers.
Only the last message has scroll-snap-align: end. As new messages are added, the list auto-scrolls to keep it in view.
scroll-snap-type: both proximity — snaps on both X and Y axes simultaneously. Perfect for map-like or grid-based interfaces.
The features nobody else explains — scroll-snap-stop, the new scrollsnapchange event, and fixing the sticky header problem.
Without scroll-snap-stop, a fast swipe can skip multiple slides. With always, the browser must stop at each snap point.
New in Chrome 129+ / Safari 18.2+. Fires when the snap target changes — perfect for syncing pagination dots, labels, or counters.
Without scroll-padding-top, snap targets slide behind a sticky header. Set it to the header height.
The most confused pair in scroll-snap. They do different things from different sides:
scroll-snap-type: mandatory can trap keyboard and screen reader users if snap targets are widely spaced and content between them becomes unreachable.
Always test with keyboard navigation. Use proximity for content-heavy pages. Add a skip link or ensure all content is reachable via the tab key.