UNPKG

nuxt-lenis

Version:

This is a Nuxt wrapper for [Lenis](https://lenis.studiofreight.com/) (by [Studio Freight](https://studiofreight.com/)) – providing smooth scrolling with support for multiple instances in a type-safe and reactive way.

28 lines (27 loc) 790 B
import type { LenisOptions, Scrolling } from 'lenis'; import { Lenis } from '#imports'; export type ScrollState = { scroll: number; animatedScroll: number; velocity: number; limit: number; progress: number; isScrolling: Scrolling; isStopped: boolean; isTouching?: boolean; isHorizontal: boolean; isLocked: boolean; isSmooth: boolean; rootElement: HTMLElement | null; direction: 1 | -1 | 0; lastVelocity: number; targetScroll: number; }; export interface LenisPlugin { createLenis: (id: string, options?: LenisOptions) => Lenis; getLenis: (id?: string) => Lenis | null; destroyLenis: (id: string) => void; getScrollState: (id?: string) => ScrollState | null; } declare const _default: any; export default _default;