0.2.0 • Published 2 years ago

use-article-progress v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

useArticleProgress hook

Simple hook to get the progress (0-100%) when reading an article. Changes as the user scrolls the page.

Usage

export function ArticleProgress() {
  const { percentage } = useArticleProgress();

  return <div>{percentage}%</div>;
}

Project Example

Check an example of usage inside /example folder.

cd example
yarn
yarn start
# open localhost:1234

An example of an article component using the progress hook