You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

vue3-scrollama

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-scrollama

A Vue 3 wrapper for Scrollama

0.2.2
latest
Source
npmnpm
Version published
Weekly downloads
1
-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

Vue3 Scrollama

Vue logo scrollama.js

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

NameTypeDefaultDescription
debugBoolfalseDisplays a debug line that shows where Scrollama cursor is.
offsetFloat0Offsets the Scrollama step cursor by X.
@step-enterEvent-Fires when entering the Scrollama component.
@step-progressEvent-Fires every time you scroll within the Scrollama component.
@step-exitEvent-Fires when you exit the Scrollama component.

More Documentation Coming soon. Thank you for your patience.

Keywords

vue3

FAQs

Package last updated on 13 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts