use-section-scroll-position

1.0.3 • Public • Published

Introduction

This module allows you to identify the position of the scroll bar in respect to the different sections of your webpage. The id of these sections are passed as an array when calling the hook. When the scroll bar enters one of these sections, it returns the id of the section, and when it leaves or it is not in a section specified in the array, it returns an empty string.

Installation

npm install use-section-scroll-position

Usage

react/typescript

import useScrollPosition from "use-section-scroll-position"

 const { scrollPosition } = useScrollPosition([
    "skills",
    "portfolio",
    "articles",
  ]);

Contribute

If you would like to contribute, you are welcome.

Readme

Keywords

Package Sidebar

Install

npm i use-section-scroll-position

Weekly Downloads

9

Version

1.0.3

License

none

Unpacked Size

16.9 kB

Total Files

17

Last publish

Collaborators

  • opsy