# smoothScroll

function in `@dioramajs/diorama/astro/client`

```ts
import { smoothScroll } from '@dioramajs/diorama/astro/client'
```

Smooth scroll on an Astro page. The first call makes the page's Lenis, later calls return it,
so a script that needs the instance calls it too. Lenis runs on its own frames until the app
of `start()` runs and drives it. On a ClientRouter swap it keeps the scroll Astro sets (the
top, the hash, the position Back restores) and its classes on <html>.

    import Lenis from 'lenis'
    import { smoothScroll } from '@dioramajs/diorama/astro/client'

    const lenis = smoothScroll(Lenis, { easing: (t) => 1 - (1 - t) ** 3, duration: 1.2 })

```ts
function smoothScroll<O extends object, L extends SmoothScroll>(
  Lenis: (options?: O) => L,
  options?: O,
): L
```

| Parameter | Type | Description |
| --- | --- | --- |
| `Lenis` | `(options?: O) => L` |  |
| `options?` | `O` |  |

Defined in [packages/diorama/src/astro-client.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/diorama/src/astro-client.ts#L51).
