Skip to content

✋ Lenis smooth scroll directive for Vue templates

Notifications You must be signed in to change notification settings

zeokku/vue-lenis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

✋ Lenis smooth scroll directive for Vue templates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages