/react-speedy-reader

Speed reader component for React, which streams the text in chunks.

Primary LanguageJavaScriptMIT LicenseMIT

React Speedy Reader

Speed reader component for React, which streams the text in chunks. Enabling the user to read long passages of text with ease.

Build Status codecov npm version

Getting Started

Prerequisites

Installing

npm install --save react-speedy-reader

or

yarn add react-speedy-reader

Usage

import React from 'react';
import { render } from 'react-dom';
import SpeedyReader from 'react-speedy-reader';

render(
  (
    <div className="demo">
      <SpeedyReader
        autoPlay
        inputText={'Lorem ipsum dolor sit amet, consectetur adipiscing elit. ' +
          'Fusce dignissim urna turpis, sed interdum massa tincidunt eget. ' +
          'Duis leo nisl, eleifend ac turpis vitae, cursus sagittis leo. ' +
          'Nullam sit amet.'}
      />
    </div>
  ),
  document.getElementById('app')
);

Props

SpeedyReader

Name Type Default Required Description
autoPlay bool false false Indicates whether the reader starts immediately
inputText string true Input text to be sped read
onFinish function undefined false Callback used when finished reading passage
speed number 250 false The speed of the reader in words per minute (WPM)
wordChunk number 1 false The number of words to be displayed per update

Methods

play()

Pauses playing of the words for the speed reading.

pause()

Resumes playing of the words for the speed reading.

reset(autoPlay?)

Resets the speedy reader to the initial state.

Documentation

Please read JSDocs for more information.

Built With

  • React - A JavaScript library for building user interfaces

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.