Lenis
by darkroom.engineering
Lightweight smooth-scroll library often paired with GSAP ScrollTrigger and WebGL scroll effects.
Web animation examples and effects Code libraryOpen sourceminimal

2. Commercial use: raw.githubusercontent.com
“to use, copy, modify, merge, publish, distribute, sublicense, and/or sell”
MIT allows use, change and sale in paid products.
raw.githubusercontent.com3. Credit the author: raw.githubusercontent.com
“The above copyright notice and this permission notice shall be included in all”
No credit on screen. Keep the license notice inside the code you ship.
raw.githubusercontent.com4. Agent access: github.com/darkroomengineering/lenis
An agent can install it by itself with npm install lenis. No key or account is needed.
github.com/darkroomengineering/lenisLicense checked Nov 5, 2026 against 1 official page. Tap a verdict to see its source. How we checked Report an error
Lenis: smooth page scrolling for websites
Lenis is a small free script that makes a web page glide when people scroll, instead of jumping in steps. It keeps the browser's own scrolling underneath, so sticky headers, links to page sections and screen readers keep working. Design studios use it with scroll animations and 3D scenes.
Where you can use it
A smoother feel on a landing page
Make wheel and trackpad scrolling glide on a portfolio or product page, added with a few lines and no build step.
Scroll animations that stay in sync
When pictures and text animate as you scroll, Lenis and the animation library move together on one clock, so effects do not lag behind the page.
Smooth jumps to page sections
Clicking Pricing or Contact in the menu glides to that part of the page, with room left for a fixed header.
3D and WebGL scenes tied to scroll
Keep a 3D scene or a moving background in step with the page as people scroll through a story site.
Smooth scrolling on a Framer site
Add the same smooth feel to a site made in Framer with the official plugin, without writing code.
Horizontal gallery sections Idea
Let a row of project images or a timeline glide sideways, for a gallery or a case study page.
As reported by darkroom.engineering: The whole library is a few KB with zero runtime dependencies; Under 5kb.
Lenis popularity
Downloads from api.npmjs.org, stars from GitHub, checked Nov 17, 2026. How the Gid Score is calculated
How to start
Tell your AI assistant
“Add lenis 1.3.27 with its recommended CSS, start it with autoRaf true and anchors true, mark the modal and the dropdown with data-lenis-prevent, and keep the default respect for reduced motion.”
Or install it yourself.
npm i lenis
Show codeStep 1 or Step 2
Start Lenis with its own animation loop turned on.
import Lenis from 'lenis'
import 'lenis/dist/lenis.css'
const lenis = new Lenis({
autoRaf: true,
});
Mark boxes that must scroll on their own, such as a modal or a long dropdown, so Lenis leaves them alone.
<div data-lenis-prevent>scrollable content</div>
Mistakes to avoid
Lenis only moves the page when raf runs every frame; otherwise scrolling looks dead.
import 'lenis/dist/lenis.css' or link dist/lenis.css from the same versionThe CSS handles stopped state, nested scroll areas and iframes; the troubleshooting list asks for it.
The current settings list has syncTouch, not smoothTouch, and the limits list warns about it on older iOS.
Lenis does not support CSS scroll-snap.
<script src="https://unpkg.com/lenis"></script> (no version, as in the site llms.txt)An unversioned link loads whatever is newest and can change behavior without warning.
License
MIT license. Free to use in personal and paid sites, with no visible credit. Keep the copyright and license notice with copies of the code.
“to use, copy, modify, merge, publish, distribute, sublicense, and/or sell” raw.githubusercontent.com
“The above copyright notice and this permission notice shall be included in all” raw.githubusercontent.com
“to use, copy, modify, merge, publish, distribute, sublicense, and/or sell” raw.githubusercontent.com
“to use, copy, modify, merge, publish, distribute, sublicense, and/or sell” raw.githubusercontent.com
AllowedWith conditionsNot allowedNot stated or not checked yet
Is Lenis free for commercial use? The full answer Not legal advice. Check the license page before you ship.
For your agent
License rules tell your agent what it may do with Lenis. Paste them into your prompt or AGENTS.md.
- Lenis (Web animation examples and effects, UI animation (Lottie, Rive)). Lightweight smooth-scroll library often paired with GSAP ScrollTrigger and WebGL scroll effects. Price: free; commercial use OK; no credit needed. Style: minimal.
Connect: npm lenis.
Get files: npm install lenis, create new Lenis() and drive it with requestAnimationFrame or GSAP's ticker (js, css).
Rule: Keep the MIT notice if you redistribute the code.
Rule: Respect prefers-reduced-motion.
License: https://raw.githubusercontent.com/darkroomengineering/lenis/main/LICENSE (checked 2026-11-05; details: https://agentgid.com/assets/lenis/)
Agent installs a package or loads it from a CDN.
npm install lenisFormats: js, css
Smooth scroll: Lenis by darkroom.engineering (MIT)Alternatives
Lenis This page
Pick GSAP when you need the scroll animations themselves (pinning, scrubbing, text effects); it pairs with Lenis rather than replacing it.
Pick AOS when you only want elements to fade or slide in as they appear, set with data attributes, without changing how the page scrolls.
Pick Animate.css for ready entrance and attention animations added with one class name.
Hundreds of official three.js WebGL/WebGPU examples (shaders, particles, post-processing, loaders) with full source in the repo's examples folder.
Gallery of React Three Fiber scenes (shaders, portals, caustics, scroll, physics, glass) linked to runnable sandboxes with source.
Questions
Does smooth scrolling break sticky headers or links to sections?
No. Lenis wraps the browser's own scroll, so sticky elements and anchor links keep working; turn on anchors for smooth jumps.
Does it work with React or Vue?
Yes. There are packages lenis/react and lenis/vue, plus a Framer plugin.
Can I change how heavy the scroll feels?
Yes. Lower lerp values (default 0.1) make it heavier and slower; or set a duration and an easing.
Can I use it on a paid client site?
Yes. It is MIT licensed; keep the license notice with the code.