scroll-util
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

scroll-util

A library for scrolling utility functions in web development.

Installation

# npm
npm install scroll-util

# yarn
yarn add scroll-util

Usage

React

import { scrollToElement } from "scroll-util";
import { useEffect } from "react";

function MyComponent() {
    return (
        <button onClick={() => scrollToElement("my-div")}>Click me!</button>
        <div id="my-div" style={{
            height: "100vh",
            width: "100%"
        }}>
            <span>My div</span>
        </div>
    );
}

Browser

scroll-util currently does not support browser JS but will do so in the future.

Note: documentation in development

Links

License

This project is licensed under the Apache-2.0 license.

Package Sidebar

Install

npm i scroll-util

Weekly Downloads

0

Version

0.0.2

License

Apache-2.0

Unpacked Size

17.7 kB

Total Files

5

Last publish

Collaborators

  • ascendus