back to home

locomotivemtl / locomotive-scroll

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

8,701 stars
1,132 forks
4 issues
JavaScriptSCSSHTML

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing locomotivemtl/locomotive-scroll in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind-ai.vercel.app/repo/locomotivemtl/locomotive-scroll)
Preview:Analyzed by RepoMind

Repository Summary (README)

Preview

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