npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

tatva-scroll

v1.12.0

Published

TatvaScroll is a lightweight, customizable smooth scrolling library that enhances the native scrolling experience across web applications. Designed to integrate seamlessly without affecting any existing layouts, styles, or JavaScript logic, TatvaScroll en

Downloads

689

Readme

TatvaScroll

TatvaScroll is a lightweight, customizable smooth scrolling library that enhances the native scrolling experience across web applications. Designed to integrate seamlessly without affecting any existing layouts, styles, or JavaScript logic, TatvaScroll ensures a smooth scrolling experience while maintaining compatibility with custom elements, sticky headers, and scroll-triggered events.

Features

  • Smooth scrolling for wheel and touch events
  • Highly customizable parameters for fine-tuning
  • Lightweight and zero-dependency
  • Framework compatibility with React, Vue, and Vanilla JavaScript
  • Non-intrusive design that preserves fixed and sticky elements and allows scroll-based logic
  • Supports both horizontal and vertical scrolling

Installation

npm Installation

npm install tatva-scroll

bun Installation

bun add tatva-scroll

yarn Installation

yarn add tatva-scroll

CDN Usage

<script type="module">
import TatvaScroll from "https://unpkg.com/tatva-scroll/dist/tatvaScroll.mjs";
</script>

Usage

Vanilla JavaScript

// Basic initialization
import TatvaScroll from 'tatva-scroll';

const tatvaScroll = new TatvaScroll({
  lerp: 0.1, // Smoothness of scroll (0-1)
  multiplier: 1, // Scroll speed multiplier
  smoothWheel: true, // Enable smooth wheel scrolling
  smoothTouch: true, // Enable smooth touch scrolling
});

// Optional: Destroy instance if needed
tatvaScroll.destroy();

React

import React, { useEffect } from 'react';
import TatvaScroll from 'tatva-scroll';

function App() {
  useEffect(() => {
    const tatvaScroll = new TatvaScroll({
      lerp: 0.1,
      multiplier: 1,
      smoothWheel: true,
      smoothTouch: true,
    });

    // Optional: Clean up on component unmount
    return () => {
      tatvaScroll.destroy();
    };
  }, []);

  return (
    <div id="scroll-container">
      {/* Your scrollable content */}
      <div style={{ height: '200vh' }}>Scroll through this content</div>
    </div>
  );
}

export default App;

Vue

<template>
  <div id="scroll-container">
    <!-- Your scrollable content -->
    <div style="height: 200vh">Scroll through this content</div>
  </div>
</template>

<script>
import { onMounted, onUnmounted } from 'vue';
import TatvaScroll from 'tatva-scroll';

export default {
  setup() {
    let tatvaScroll;

    onMounted(() => {
      tatvaScroll = new TatvaScroll({
        lerp: 0.1,
        multiplier: 1,
        smoothWheel: true,
        smoothTouch: true,
      });
    });

    onUnmounted(() => {
      tatvaScroll.destroy();
    });
  },
};
</script>

HTML Direct Integration

<!DOCTYPE html>
<html>
<head>
  <title>TatvaScroll Example</title>
  <style>
    #scroll-container {
      height: 200vh;
    }
  </style>
</head>
<body>
  <div id="scroll-container">
    <!-- Your scrollable content -->
    Scroll through this content
  </div>

  <script type="module">
    import TatvaScroll from "https://unpkg.com/tatva-scroll/dist/tatvaScroll.mjs";

    const tatvaScroll = new TatvaScroll({
      lerp: 0.1,
      multiplier: 1,
      smoothWheel: true,
      smoothTouch: true,
    });
  </script>
</body>
</html>

Configuration Options

| Option | Type | Default | Description | |------------------|---------|--------------------|-----------------------------------------------------------------------------| | lerp | Number | 0.1 | Smoothness of scroll (0-1). Lower values result in smoother scrolling. | | multiplier | Number | 1 | Scroll speed multiplier. Less than 1 slows down scrolling. | | smoothWheel | Boolean | true | Enable smooth mouse wheel scrolling. | | smoothTouch | Boolean | true | Enable smooth touch/trackpad scrolling. | | scrollbarWidth | String | '10px' | Width of the custom scrollbar. | | scrollbarColor | String | 'rgba(0, 0, 0, 0.5)' | Color of the custom scrollbar. |

Methods

  • destroy(): Removes all event listeners and resets scroll behavior.
  • scrollTo(target, options): Scroll to a specific position or element.
    • target: Accepts a selector, an HTMLElement, or a number.
    • options: Configuration for the scroll behavior (e.g., duration).

Example: Scroll to a Specific Element

const tatvaScroll = new TatvaScroll();

// Scroll to an element with an ID
tatvaScroll.scrollTo('#target-element');

// Scroll to a specific Y position
tatvaScroll.scrollTo(500);

Created By

TatvaTech - Smooth Scrolling Simplified