# implement_lenis_scroll

A skill that walks the agent through wiring Lenis into a React or Next.js app: package install, a wrapper component, layout integration. Useful when you want smooth scrolling without writing the hook yourself.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 468 installs
- Author: jerrar670
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/jerrar670/surf-website/tree/HEAD/.agent/skills/implement_lenis_scroll/SKILL.md
- Updated: 2026-01-20
- HTML: https://affpapa.org/en/nevibecode/skills/implement-lenis-scroll

## What it does

The agent works in three passes. First it installs `lenis`. Then it writes `SmoothScroll.tsx` marked `'use client'`, where a `useEffect` builds the Lenis instance with a duration, easing and wheel settings, and `requestAnimationFrame` keeps calling `lenis.raf`. Cleanup runs `destroy()` on unmount.

Finally the wrapper goes into `layout.tsx` around `children`. It is a client component, so in the App Router it needs the `'use client'` line; skip that and the page scrolls exactly as before. For GSAP ScrollTrigger the skill suggests listening to Lenis `scroll` events and driving the ticker with `gsap.ticker`.

You need a React or Next.js project to start. The skill also lists `@studio-freight/lenis` as the older package name if your setup still uses it.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add jerrar670/surf-website --skill implement_lenis_scroll -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/implement_lenis_scroll/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/implement_lenis_scroll/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add jerrar670/surf-website --skill implement_lenis_scroll -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/implement_lenis_scroll/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add jerrar670/surf-website --skill implement_lenis_scroll -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/implement_lenis_scroll/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install jerrar670/surf-website implement_lenis_scroll
```

2. **Manually: put the files in place**
- File: `.github/skills/implement_lenis_scroll/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add jerrar670/surf-website --skill implement_lenis_scroll -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/jerrar670/surf-website --path .agent/skills/implement_lenis_scroll
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/implement_lenis_scroll/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add jerrar670/surf-website --skill implement_lenis_scroll -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/jerrar670/surf-website/tree/HEAD/.agent/skills/implement_lenis_scroll/SKILL.md

## When to use it
- add Lenis scrolling to a Next.js App Router layout
- extract smooth scrolling into a reusable client component
- destroy the Lenis instance when the component unmounts
- keep GSAP ScrollTrigger in sync with Lenis
- pick between the `lenis` and `@studio-freight/lenis` packages

## Example prompts
- Add Lenis smooth scrolling to this Next.js app.
- Create `SmoothScroll` and wrap `children` with it in `layout.tsx`.
- Hook Lenis up to ScrollTrigger so the animations keep pace.

## Similar
- [frontend-design](https://affpapa.org/en/nevibecode/skills/frontend-design.md) — skill · 1025790 installs
- [design-taste-frontend](https://affpapa.org/en/nevibecode/skills/design-taste-frontend.md) — skill · 678700 installs
- [prototype](https://affpapa.org/en/nevibecode/skills/prototype.md) — skill · 986201 installs
- [hyperframes](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes.md) — skill · 1200000 installs
- [hyperframes-cli](https://affpapa.org/en/nevibecode/skills/heygen-com-hyperframes-cli.md) — skill · 1300000 installs
- [webapp-testing](https://affpapa.org/en/nevibecode/skills/webapp-testing.md) — skill · 186758 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
