Potiah (pronounced /pot'jΚΙ¦/, means train in Ukrainian) is a thin Vue.js wrapper for
precious Locomotive Scroll π.
"It utilizes native
Vuefeatures such as components and composables to give maximum control overLocomotiveScrollAPI to developer and make it easier to integrate it into aVueapp."β ChatGPT
Warning
The project is unstable and depends on Locomotive Scroll v5 beta. So there might be some breaking changes in the future unless stable (first major) version is released. Best regards!
npm install potiahpnpm add potiahyarn add potiahSpecified version
<script src="https://unpkg.com/potiah@1.0.0-alpha.1"></script>Latest
<script src="https://unpkg.com/potiah"></script>β Also note, that you need to load lenis styles from CDN too
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/locomotive-scroll@beta/bundled/locomotive-scroll.css">import 'locomotive-scroll/locomotive-scroll.css' // if you install trough package manager
import { createPotiah } from 'potiah'
import App from './App.vue'
const app = createApp(App)
app.use(createPotiah())
app.mount('#app')<script setup lang="ts">
import { ScrollView } from 'potiah'
</script>
<template>
<ScrollView root :duration="1.7">
<!-- your components/content-->
</ScrollView>
</template><script setup lang="ts">
import { ScrollView, ScrollComponent } from 'potiah'
</script>
<template>
<ScrollView root :duration="1.7">
<ScrollComponent class="first-scroll-component" :speed="0.2" css-progress>
<!-- your components/content-->
</ScrollComponent>
<!-- your components -->
</ScrollView>
</template><script setup lang="ts">
import { usePotiah } from 'potiah'
const { scrollTo } = usePotiah()
// example
function handleClickOnSomeElement({target}) {
scrollTo(target)
}
</script>Potiah- π.<ScrollView />- wrapper for scrollable scene. It can be whole document or any container element inside the DOM.<ScrollComponent />-scroll elementwithin scroll scene. It gathers alldata-*attributes from Locomotive Scroll element.usePotiah- composable that returns currentPotiahinstance,scrollTofunction, refs with scroll data.
Tip
For more information please visit Documentation π
- Locomotive Scroll
- Lenis
- Train from logo - Aslan Almukhambetov CC Attribution License via SVG Repo