locomotivemtl/locomotive-scroll

🛤 Detection of elements in viewport & smooth scrolling with parallax.

JavaScript

8,870

408 commits

updated Jun 30, 2026

See the code

README

Locomotive Scroll

npm version npm downloads bundle size

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

npm install locomotive-scroll
import LocomotiveScroll from 'locomotive-scroll';

const scroll = new LocomotiveScroll();
@import 'locomotive-scroll/dist/locomotive-scroll.css';
<div data-scroll data-scroll-speed="0.5">I move at half speed</div>

Features

  • 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

Demo

Check out the examples and playground

Support

GitHub Issues

in-view
javascript
parallax
smooth-scrolling

locomotivemtl/locomotive-scroll

🛤 Detection of elements in viewport & smooth scrolling with parallax.

JavaScript

8,870

408 commits

updated Jun 30, 2026

See the code

README

Locomotive Scroll

npm version npm downloads bundle size

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

npm install locomotive-scroll
import LocomotiveScroll from 'locomotive-scroll';

const scroll = new LocomotiveScroll();
@import 'locomotive-scroll/dist/locomotive-scroll.css';
<div data-scroll data-scroll-speed="0.5">I move at half speed</div>

Features

  • 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

Demo

Check out the examples and playground

Support

GitHub Issues

in-view
javascript
parallax
smooth-scrolling

Project health

Overall

3.9/10

Maintained

0/10

Code review

2/10
OpenSSF Scorecard

Latest release

5.0.1 · Jan 15, 2026

Releases this year

2

Significant stargazers

(top 24 of 25)

Eduardo San Martin Morote

6,580 followers · starred Sep 2024

Robbie Wagner

303 followers · starred Jan 2021

Kendall Strautman Swarthout

141 followers · starred Aug 2023

Daniel

138 followers · starred Jan 2022