vue-lenis
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Lenis smooth scroll directive for Vue templates

Installation

Install the library

pnpm add vue-lenis

Add the plugin to your Vue app:

import lenis from "vue-lenis";

createApp(App)
  .use(lenis)
  .mount("#app");

Usage

Just specify v-lenis directive on a scrollable element and it's done!

<template lang="pug">
.view(v-lenis)
    .content
        // ...
</template>

Optionally you can provide an object with fields for the value:

  • ref - Vue ref which will be assigned a lenis instance, available in onMounted() hook
  • registerRaf - If you want to run lenis.raf() by yourself, set it to false. (Default: true)
  • settings - Object with lenis instance settings

/vue-lenis/

    Package Sidebar

    Install

    npm i vue-lenis

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.66 kB

    Total Files

    6

    Last publish

    Collaborators

    • zeokku