SmoothScroll interface
The part of Lenis 1.3 the page side uses on top of what the adapter needs.
import type { SmoothScroll } from '@dioramajs/diorama/astro/client'interface SmoothScroll extends LenisLikeMembers
| Name | Type | Description |
|---|---|---|
readonly actualScroll | number | Native scroll position, px. |
readonly animatedScroll | number | Smoothed scroll position, px. |
readonly className | string | Lenis' classes for <html>, e.g. 'lenis lenis-stopped'. |
destroy | () => void | Removes Lenis from the page. |
readonly isHorizontal | boolean | Whether Lenis scrolls horizontally. |
readonly isScrolling | boolean | 'native' | 'smooth' | Whether and how Lenis is scrolling. |
readonly limit | number | Maximum scroll, px. |
readonly options | { autoRaf?: boolean; readonly infinite?: boolean; readonly wrapper?: Window | Element } | Lenis options the adapter reads. |
raf | (time: number) => void | Advances Lenis to |
scrollTo | (target: number, options: { force: boolean; immediate: boolean }) => void | Scrolls to a position. |
targetScroll | number | Where a smooth scroll in flight ends, px. |
time | number | Lenis time, ms. The pump writes it to keep Lenis on the driver's clock. |
on | | Listens to a Lenis event. Returns the unsubscribe function. |
resize | | Measures the page again and takes the native scroll position. |
Defined in packages/diorama/src/astro-client.ts.