https://github.com/locomotivemtl/locomotive-scroll
🛤 Detection of elements in viewport & smooth scrolling with parallax.
https://github.com/locomotivemtl/locomotive-scroll
in-view javascript parallax smooth-scrolling
Last synced: 14 days ago
JSON representation
🛤 Detection of elements in viewport & smooth scrolling with parallax.
- Host: GitHub
- URL: https://github.com/locomotivemtl/locomotive-scroll
- Owner: locomotivemtl
- License: mit
- Created: 2016-10-12T20:12:46.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2026-06-30T19:36:53.000Z (4 months ago)
- Last Synced: 2026-10-01T04:01:29.644Z (about 1 month ago)
- Topics: in-view, javascript, parallax, smooth-scrolling
- Language: JavaScript
- Homepage: https://scroll.locomotive.ca
- Size: 12.9 MB
- Stars: 8,868
- Watchers: 77
- Forks: 1,114
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- frontend-design-resources - Locomotive Scroll
- fucking-awesome-javascript - locomotive-scroll - Detects the elements in viewport and smooth scrolling with parallax. (Scroll / Other)
- my-awesome-list - locomotive-scroll
- awesome-webdev-resources - Locomotive Scroll
- awesome-javascript - locomotive-scroll - Detects the elements in viewport and smooth scrolling with parallax. (Scroll / Other)
- awesome-github-projects - locomotive-scroll - 🛤 Detection of elements in viewport & smooth scrolling with parallax. ⭐8,872 `JavaScript` (🔧 Utilities & Miscellaneous)
- awesome-web-animation - Locomotive Scroll - Detection of elements in viewport and smooth scrolling with parallax. (Animate on scroll)
- awesome-javascript - locomotivemtl/locomotive-scroll - 🛤 Detection of elements in viewport & smooth scrolling with parallax. (Web / Frontend and UI Components)
README
# Locomotive Scroll
[](https://www.npmjs.com/package/locomotive-scroll)
[](https://www.npmjs.com/package/locomotive-scroll)
[](https://bundlephobia.com/package/locomotive-scroll)
A **lightweight** & **modern** scroll library for detection, animation, and smooth scrolling. Built on top of [Lenis](https://github.com/darkroomengineering/lenis).
## Documentation
Full documentation available at [scroll.locomotive.ca/docs](https://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.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](https://scroll.locomotive.ca/docs/examples)
## Support
[GitHub Issues](https://github.com/locomotivemtl/locomotive-scroll/issues)