locomotivemtl /locomotive-scroll
🛤 Detection of elements in viewport & smooth scrolling with parallax.
★ 8,899⑂ 1,111👁 70⑃ 153● 498▤ 17
+1
Daily
8,899
stars
1,111
forks
70
watchers
153
prs
498
issues
17
releases
README
Locomotive Scroll A lightweight & modern scroll library for detection, animation, and smooth scrolling. Built on top of Lenis. Documentation Full documentation available at scroll.locomotive.ca/docs. Quick Start bash npm install locomotive-scroll js import LocomotiveScroll from 'locomotive-scroll'; const scroll = new LocomotiveScroll(); css @import 'locomotive-scroll/dist/locomotive-scroll.css'; html I move at half speed Features - Lightweight — Only 9.9kB gzipped - TypeScript First — Fully typed - Built on Lenis — Latest stable release with improved performance - Dual Intersection Observers — Optimized detection for triggers vs. animations - Smart Touch Detection — Parallax auto-disabled on mobile - Accessible — Native scrollbar, keyboard navigation, proper ARIA support Demo Check out the examples and playground Support GitHub Issues
Top issues
#631Horizontal scroll is not working0 comments · 2026-10-16#630Next.js example unavailable0 comments · 2026-09-29#629[data-scroll-offset="calc(100% - 100px), 0"]0 comments · 2026-07-16#596Expose a useLocomotiveScroll hook0 comments · 2026-02-05
Latest release
v5.1.1 v5.1.1 2026-11-13Fixed - An element with data-scroll-delay stops rendering once it is out of the viewport. It used to update its transform on every frame while scrolling and for about 1.5 seconds after. It now jumps to its final position out of sight, and resumes from there when it comes back. - data-scroll-position="start,end", the documented default, no longer puts the element in the per-frame loop. The library compared it to top,bottom instead. An explicit top,bottom now gets the per-frame loop, with the same result as before. - Scroll elements are measured once per resize instead of twice. The library lis