
Implement Lenis Scroll
Lenis is one of those libraries that makes scrolling feel like butter, and this skill walks you through wiring it up in React or Next.js. You get a clean setup using a wrapper component with `useEffect` and `requestAnimationFrame`, plus sensible defaults for duration and easing. The guide covers both the newer `lenis` package and the older `@studio-freight/lenis`, and includes a note about GSAP ScrollTrigger integration if you're doing scroll animations. It's straightforward, maybe 10 minutes of work, and the difference in feel is immediately noticeable. Worth it if you're building anything where scroll experience matters.
- install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
- 166
- skills.sh installs
- 162
- last updated
- Aug 21, 2026
Install
$ npx -y skills add jerrar670/surf-website --skill implement_lenis_scroll --agent claude-codeInstalls into .claude/skills of the current project.
Files
Implement Lenis Smooth Scroll
This skill guides you through adding buttery smooth scrolling to a React/Next.js application using @studio-freight/lenis (or the newer lenis package).
Prerequisites
- A React or Next.js project.
Steps
1. Install Dependencies
Install the Lenis package.
npm install lenis
# OR depending on version preference
npm install @studio-freight/lenis
2. Create the Lenis Hook/Component
It's best to encapsulate Lenis in a reusable component or hook.
Option A: Global Component (Recommended for Next.js App Router)
Create src/lib/lenis.ts or src/components/SmoothScroll.tsx.
// src/components/SmoothScroll.tsx
'use client'
import { ReactNode, useEffect } from 'react'
import Lenis from 'lenis'
export default function SmoothScroll({ children }: { children: ReactNode }) {
useEffect(() => {
const lenis = new Lenis({
duration: 1.2,
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)),
orientation: 'vertical',
gestureOrientation: 'vertical',
smoothWheel: true,
})
function raf(time: number) {
lenis.raf(time)
requestAnimationFrame(raf)
}
Sponsors
Details
- Repository
- github.com/jerrar670/surf-website
- Category
- Frontend Development
- First seen
- Jun 3, 2026