Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sericaia/use-article-progress

Utility hook to show progress made when reading an article
https://github.com/sericaia/use-article-progress

Last synced: 19 days ago
JSON representation

Utility hook to show progress made when reading an article

Awesome Lists containing this project

README

        

# `useArticleProgress` hook

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

## Usage

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

return

{percentage}%
;
}
```

## Project Example

Check an example of usage inside `/example` folder.

```bash
cd example
yarn
yarn start
# open localhost:1234
```

![An example of an article component using the progress hook](./example/docs/demo.gif)