Detection of elements in viewport & smooth scrolling with parallax effects.
npm install locomotive-scroll


A lightweight & modern scroll library for detection, animation, and smooth scrolling. Built on top of Lenis.
Full documentation available at scroll.locomotive.ca/docs.
``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
- Lightweight — Only 9.4kB 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
Check out the examples and playground