Generate Lenis Setup
lenis_generate_setupGenerate complete Lenis smooth scroll setup code for vanilla JS, React, Vue, or Next.js, with optional GSAP ScrollTrigger, snap scrolling, and custom RAF loop.
Instructions
Generates complete Lenis smooth scroll setup code for a given framework.
Supports vanilla JS, React, Vue, and Next.js with optional GSAP ScrollTrigger integration, snap scrolling, and custom RAF loop configuration.
Args:
framework ('vanilla' | 'react' | 'vue' | 'nextjs'): Target framework (default: 'vanilla')
with_gsap (boolean): Include GSAP ScrollTrigger integration (default: false)
with_snap (boolean): Include lenis/snap package (default: false)
custom_raf (boolean): Use custom requestAnimationFrame loop (default: false)
settings (object): Custom Lenis settings to include
Returns: Complete setup code with installation commands, imports, initialization, CSS, and comments.
Examples:
"Set up Lenis with GSAP in React" → framework: 'react', with_gsap: true
"Basic smooth scroll for vanilla JS" → framework: 'vanilla'
"Next.js app with snap scrolling" → framework: 'nextjs', with_snap: true
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| settings | No | Custom Lenis settings to include (e.g., { lerp: 0.05, duration: 1.5 }) | |
| framework | No | Target framework: vanilla, react, vue, or nextjs | vanilla |
| with_gsap | No | Include GSAP ScrollTrigger integration | |
| with_snap | No | Include lenis/snap package for scroll snapping | |
| custom_raf | No | Use custom requestAnimationFrame loop instead of autoRaf |