Skip to content

Utility hook to show progress made when reading an article

License

Notifications You must be signed in to change notification settings

sericaia/use-article-progress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Utility hook to show progress made when reading an article

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published