Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 499 Bytes

README.md

File metadata and controls

26 lines (18 loc) · 499 Bytes

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