@bowriverstudio/readingtime
v1.0.0
Published
React Component similar to Medium's reading time estimation.
Downloads
19
Maintainers
Readme
Reading Time
This package calculates the estimated reading time based on Medium's algorithm. 200 words per min plus 12 seconds per image.
The output is a simple react component.
Installation
npm i @bowriverstudio/readingtime
Sample Usage
import ReadingTime from "@bowriverstudio/readingtime";
<ReadingTime theContent={post.content.rendered}></ReadingTime>
<ReadingTime
theContent={post.content.rendered}
wordsPerMinute="100"
></ReadingTime>
<ReadingTime
theContent={post.content.rendered}
imagesPerMinute="1"
></ReadingTime>
export const StyledReadingTime = styled(ReadingTime)`
color: red;
`;
<StyledReadingTime
theContent={post.content.rendered}
imagesPerMinute="1"
></StyledReadingTime>
Demo
Simple demo using Frontity and this readingtime package.
https://reading-time-demo.bowriverstudio.vercel.app https://github.com/Bowriverstudio/reading-time-demo
Code
https://github.com/Bowriverstudio/readingtime