Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/sericaia/use-article-progress
- Owner: sericaia
- License: mit
- Created: 2022-04-26T10:51:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-04-27T10:29:10.000Z (over 2 years ago)
- Last Synced: 2024-09-28T14:06:17.879Z (about 1 month ago)
- Language: TypeScript
- Size: 405 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)