# Lenis — card for AI agents

Lightweight smooth-scroll library often paired with GSAP ScrollTrigger and WebGL scroll effects.

Category: Web animation examples and effects (also: UI animation (Lottie, Rive)) · maker darkroom.engineering · checked 2026-11-05 · style: minimal

## Price
- Price: Free
- Free tier: Fully free.

## License
MIT — https://raw.githubusercontent.com/darkroomengineering/lenis/main/LICENSE

- commercial: **yes** (Commercial use OK)
  > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  (https://raw.githubusercontent.com/darkroomengineering/lenis/main/LICENSE)
- attribution: **no** (No credit needed)
  > The above copyright notice and this permission notice shall be included in all
  (https://raw.githubusercontent.com/darkroomengineering/lenis/main/LICENSE)
- in app: **yes** (Can ship inside your app)
  > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  (https://raw.githubusercontent.com/darkroomengineering/lenis/main/LICENSE)
- redistribute: **yes** (Can pass the files on to your own users)
  > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  (https://raw.githubusercontent.com/darkroomengineering/lenis/main/LICENSE)

## Rules to follow
- Keep the MIT notice if you redistribute the code.
- Respect prefers-reduced-motion.

## Can an AI agent use it by itself?
**Yes** · package: Agent installs a package or loads it from a CDN

## How an agent gets files
- npm install lenis, create new Lenis() and drive it with requestAnimationFrame or GSAP's ticker. (sign-in: none)
- Formats: js, css

## How to connect
- Package (npm/PyPI)
- npm: `npm install lenis`
- Repository: https://github.com/darkroomengineering/lenis
- Website: https://lenis.dev

## Numbers (AgentGid data)
- Gid Score: 59
- GitHub stars: 17,316
- Downloads last week: 2,747,298
- Used in 38 public projects set up for AI coding agents

## Lines to paste 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/)
```

## Links
- AgentGid page: https://agentgid.com/assets/lenis/
- Is it free for commercial use? https://agentgid.com/assets/lenis/commercial-use/
- Source: https://lenis.dev/
- Source: https://raw.githubusercontent.com/darkroomengineering/lenis/main/LICENSE
- Source: https://registry.npmjs.org/lenis/latest


## 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 to 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: Let a row of project images or a timeline glide sideways, for a gallery or a case study page. (idea, not from the official pages)

### How to start
- Install the package, or add the script and style lines from the no-code setup.

```
npm i lenis
```

- 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>
```


### 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.

### Good to know
- People who turned on reduced motion in their system get normal, unsmoothed scrolling by default. Keep it that way.
- The browser's built-in snap to sections does not work with it; a separate snap add-on does that job.
- Smoothing stops over embedded frames such as video or map embeds, and Safari limits it to 60 frames per second.
- Boxes that scroll on their own inside the page, like a modal, need a setting or a marker, or they stop scrolling smoothly.

Checked 2026-11-09 against: https://lenis.dev/, https://lenis.dev/llms.txt, https://github.com/darkroomengineering/lenis, https://github.com/darkroomengineering/lenis/blob/main/README.md, https://github.com/darkroomengineering/lenis/blob/main/LICENSE, https://registry.npmjs.org/lenis/latest, https://registry.npmjs.org/lenis/1.3.27

### Mistakes to avoid
- Don't: new Lenis() with no autoRaf and no animation loop → Do: new Lenis({ autoRaf: true }), or call lenis.raf(time) in your own requestAnimationFrame or GSAP ticker loop (Lenis only moves the page when raf runs every frame; otherwise scrolling looks dead.)
- Don't: Leaving out lenis.css → Do: import 'lenis/dist/lenis.css' or link dist/lenis.css from the same version (The CSS handles stopped state, nested scroll areas and iframes; the troubleshooting list asks for it.)
- Don't: smoothTouch: true (from older guides and the site llms.txt) → Do: syncTouch: true, only when you need touch scroll synced (The current settings list has syncTouch, not smoothTouch, and the limits list warns about it on older iOS.)
- Don't: CSS scroll-snap-type on sections together with Lenis → Do: Use the lenis/snap add-on for snapping (Lenis does not support CSS scroll-snap.)
- Don't: <script src="https://unpkg.com/lenis"></script> (no version, as in the site llms.txt) → Do: Pin the version, e.g. https://unpkg.com/lenis@1.3.27/dist/lenis.min.js, or install from npm (An unversioned link loads whatever is newest and can change behavior without warning.)

### 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.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
