vue3-scrollama
A Vue 3 wrapper for Scrollama
922
| Install | |
|---|---|
npm install vue3-scrollama |
|
| Latest Version: | 0.2.2 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Jun 11, 2024 |
| Links: | GitHub · npm |
Maintainer: devarteneur
Vue3 Scrollama
A Vue 3 wrapper for Scrollama, a modern & lightweight JavaScript library for scrollytelling using IntersectionObserver in favor of scroll events.
Installation
npm install vue3-scrollama intersection-observer
Scrollama uses IntersectionObserver, we must manually add the polyfill for cross-browser support.
Usage
Import the component locally in your component:
import VueScrollama from "vue3-scrollama";
Basic Example
<template>
<div>
<VueScrollama
:debug="false"
:offset="0.55"
@step-enter="({ element }) => (currStep = element.dataset.stepNo)"
class="main__scrollama"
>
<div class="step" data-step-no="1">
Step 1
</div>
<div class="step" data-step-no="2">
Step 2
</div>
<div class="step" data-step-no="3">
Step 3
</div>
</VueScrollama>
<div>{{currStep}}</div>
</div>
</template>
<script setup>
import VueScrollama from 'vue3-scrollama'
let currStep = ref(null);
</script>
Props
| Name | Type | Default | Description |
|---|---|---|---|
| debug | Bool |
false |
Displays a debug line that shows where Scrollama cursor is. |
| offset | Float |
0 |
Offsets the Scrollama step cursor by X. |
| @step-enter | Event |
- |
Fires when entering the Scrollama component. |
| @step-progress | Event |
- |
Fires every time you scroll within the Scrollama component. |
| @step-exit | Event |
- |
Fires when you exit the Scrollama component. |
More Documentation Coming soon. Thank you for your patience.
Related Packages
vue-scrollama
Easy scroll-driven interactions (scrollytelling) for Vue 3, powered by Scrollama
8,829
478
@scrolllab/embed
Embed a ScrollLab hosted section (or a pack of sections) with one tag. React, Ne...
0
markdown-to-jsx
A very fast and versatile markdown toolchain. AST, React, React Native, SolidJS,...
214,042,213
2,394
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.2.2 | ^3.2.13 | MIT | |
| 0.2.1 | ^3.2.13 | MIT | |
| 0.2.0 | ^3.2.13 | MIT | |
| 0.1.4 | ^3.2.13 | MIT | |
| 0.1.3 | ^3.2.13 | MIT | |
| 0.1.2 | ^3.2.13 | MIT | |
| 0.1.1 | ^3.2.13 | MIT | |
| 0.1.0 | ^3.2.13 | MIT |