# locomotive-scroll

> Detection of elements in viewport & smooth scrolling with parallax effects.

Latest version **5.0.1** (published 2026-01-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install locomotive-scroll
pnpm add locomotive-scroll
yarn add locomotive-scroll
bun add locomotive-scroll
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.0.1 |
| Published | 2026-01-15 |
| First published | 2019-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 1 |
| Unpacked size | 513.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8858 |
| Author | Locomotive |
| Maintainers | jerek0, devenini, arnvvd |
| Keywords | front-end, javascript, smooth-scrolling, parallax, scroll |

## Links

- npm: https://www.npmjs.com/package/locomotive-scroll
- Repository: https://github.com/locomotivemtl/locomotive-scroll
- Issues: https://github.com/locomotivemtl/locomotive-scroll/issues
- npm.io page: https://npm.io/package/locomotive-scroll

## Dependencies (1)

- [lenis](https://npm.io/package/lenis.md) 1.3.17

## Recent versions

- 5.0.1 (latest) — 2026-01-15
- 5.0.0-rc.1 (rc) — 2026-01-08
- 5.0.0-beta.21 (beta) — 2024-08-30
- 5.0.0 — 2026-01-15
- 5.0.0-beta.20 — 2024-08-30
- 5.0.0-beta.19 — 2024-08-30
- 5.0.0-beta.18 — 2024-08-30
- 5.0.0-beta.17 — 2024-08-30
- 5.0.0-beta.16 — 2024-08-30
- 5.0.0-beta.15 — 2024-08-19
- 5.0.0-beta.14 — 2024-08-13
- 5.0.0-beta.13 — 2024-05-30
- 5.0.0-beta.12 — 2024-04-29
- 5.0.0-beta.11 — 2023-11-30
- 5.0.0-beta.10 — 2023-11-21
- … 69 more at https://npm.io/package/locomotive-scroll/versions

## README

# Locomotive Scroll

[![npm version](https://img.shields.io/npm/v/locomotive-scroll.svg)](https://www.npmjs.com/package/locomotive-scroll)
[![npm downloads](https://img.shields.io/npm/dm/locomotive-scroll.svg)](https://www.npmjs.com/package/locomotive-scroll)
[![bundle size](https://img.shields.io/bundlephobia/minzip/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
<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](https://scroll.locomotive.ca/docs/examples)

## Support

[GitHub Issues](https://github.com/locomotivemtl/locomotive-scroll/issues)

---
_Source: https://npm.io/package/locomotive-scroll · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
