+19
Daily
+223
Weekly
+814
Monthly
17,283
stars
795
forks
65
watchers
171
prs
341
issues
115
releases
README
Introduction
Lenis ("smooth" in latin) is a lightweight, robust, and performant smooth scroll library. It's designed by @darkroom.engineering to be simple to use and easy to integrate into your projects. It's built with performance in mind and is optimized for modern browsers. It's perfect for creating smooth scrolling experiences on your website such as WebGL scroll syncing, parallax effects, and much more, see Demo and Showcase.
Read our Manifesto to learn more about the inspiration behind Lenis.
- Features
- Sponsors
- Packages
- Showcase
- Installation
- Setup
- No-code usage
- Settings
- Properties
- Methods
- Events
- Considerations
- Limitations
- Troubleshooting
- Tutorials
- Plugins
- License
Features
- Lightweight & dependency-free — the whole library is a few KB with zero runtime dependencies
- Runs on native scroll — wraps the browser's own scroll, so position: sticky, anchor links, and accessibility keep working
- Any axis — smooth vertical, horizontal, and nested scrolling from a single instance
- Built for sync — drives WebGL scroll scenes, GSAP ScrollTrigger, and parallax off one loop
- Framework adapters — first-class packages for React, Vue, and Framer
- Scroll snapping — the snap plugin aligns sections without fighting the smooth scroll
Sponsors
If you’ve used Lenis and it made your site feel just a little more alive, consider sponsoring.
Your support helps us smooth out the internet one library at a time—and lets us keep building tools that care about the details most folks overlook.
Packages
- lenis
- lenis/react
- lenis/vue
- lenis/framer
- lenis/snap
Installation
Using a package manager:
bash
npm i lenis
or
yarn add lenis
or
pnpm add lenis
js
import Lenis from 'lenis'
Using scripts:
html
Setup
Basic:
js
// Initialize Lenis
const lenis = new Lenis({
autoRaf: true,
});
// Listen for the scroll event and log the event data
lenis.on('scroll', (e) = {
console.log(e);
});
Custom raf loop:
js
// Initialize Lenis
const lenis = new Lenis();
// Use requestAnimationFrame to continuously update the scroll
function raf(time) {
lenis.raf(time);
requestAnimationFrame(raf);
}
requestAnimationFrame(raf);
Recommended CSS:
Import stylesheet:
js
import 'lenis/dist/lenis.css'
Or link the CSS file:
html
Or add it manually:
See lenis.css stylesheet
GSAP ScrollTrigger:
js
// Initialize a new Lenis instance for smooth scrolling
const lenis = new Lenis();
// Synchronize Lenis scrolling with GSAP's ScrollTrigger plugin
lenis.on('scroll', ScrollTrigger.update);
// Add Lenis's requestAnimationFrame (raf) method to GSAP's ticker
// This ensures Lenis's smooth scroll animation updates on each GSAP tick
gsap.ticker.add((time) = {
lenis.raf(time 1000); // Convert time from seconds to milliseconds
});
// Disable lag smoothing in GSAP to prevent any delay in scroll animations
gsap.ticker.lagSmoothing(0);
No-code usage
One line, no build step — just drop this inTop issues
#103MacOS Safari position:fixed jitter24 comments · 2023-01-19#12Scroll Snapping not working19 comments · 2022-08-28#131Different scroll speed on different browsers11 comments · 2023-03-07#117Idea: Auto wrapper and content detection11 comments · 2023-02-05#533isScrolling/progress emitter doesn't always settle despite visually settling.8 comments · 2026-07-30#237Optionally disable smooth scrolling on trackpads8 comments · 2023-10-01#287ROADMAP7 comments · 2024-01-31#298On MAC OS Sonoma, Safari V17 smoothWheel set to false won't work with overscroll-behavior: contain6 comments · 2024-02-14
Discussions
#543Overscroll apparently not working1 comments · 2026-09-23#467Any way to disable user scroll events without lenis.stop()1 comments · 2025-06-13#438Lenis with gsap and custom RAF1 comments · 2025-02-14#431Performances issue with Lenis , GSAP & R3F on mobile2 comments · 2025-01-23#428Read/write batching for render loop1 comments · 2025-01-09#427Stop the body scroll while a modal is open, lenis.2 comments · 2025-01-09#421How to listen to scrollTo "cancel"1 comments · 2024-12-13#412Lenis Scrolling with SSR in Next.js 152 comments · 2024-11-16
Latest release
v1.3.27 v1.3.27 2026-10-15- fix lenis class coming back after destroy() - scrollTo() accepts SVG elements