jerrar670 avatar

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

Installs 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

More from jerrar670/surf-website

All 2
1solar-luna avatarwechat-article-formattersolar-luna/fully-automatic-article-generation-skill将Markdown文章转换为美化的HTML格式,适配微信公众号发布。应用专业CSS样式、代码高亮、优化排版。当用户说"美化这篇文章"、"转换为HTML"、"优化公众号格式"、"生成公众号HTML"时使用。157skills.sh installs
2oimiragieo avatardiagram-generatoroimiragieo/agent-studioGenerates architecture, database, and system diagrams using Mermaid syntax. Creates visual representations of system architecture, database schemas, component r146skills.sh installs
3webmaxru avatarenonic-webhook-integratorwebmaxru/enonic-agent-skillsSets up Enonic XP event listeners, webhook configurations, and external system integrations triggered by content lifecycle events. Covers lib-event listener reg144skills.sh installs
4postplusai avatarxiaohongshu-article-packagerpostplusai/postplus-skillsLay out an existing draft or script into a Xiaohongshu image-post or long-image package without rewriting the source. Use this when the user wants pagination, h138skills.sh installs
5yonatangross avatardashboard-patternsyonatangross/orchestkitDashboard UI patterns with widget composition, real-time data updates, responsive grid layouts, and data tables for React applications. Use when building dashbo124skills.sh installs
6andrelandgraf avatarbase-app-setupandrelandgraf/fullstackrecipesComplete setup guide for a Next.js app with Shadcn UI, Neon Postgres, Drizzle ORM, and AI SDK.122skills.sh installs