2.0.3 • Published 4 years ago

react-typetool v2.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

React component to simulate typing. You can customize the caret by calling the caret reference.

Install

npm install react-typetool --save

Usage

import React, { Component } from 'react';
import Typer from 'react-typetool';

class App extends Component {
  render() {
    return <Typer text="Text to type." />
  }
}

Properties

propoptionaltypedescriptiondefaultexample
textyesstringText to type'Hello earthlings!'
classesyesstringClasses to add to the component'introTyper'
useDefaultStyleyesbooleanApply default style? (Set false to style with your own CSS)truefalse
startStepyesnumberIndex of string character to start from05
stepIntervalMSyesnumberTime between each character in milliseconds200240
blinkyesbooleanShould the caret blink?truefalse
blinkIntervalMSyesnumberTime between each caret blink in milliseconds500300
onStartyescallbackGets called when the animation starts() => { console.log('Started typing') }
onFinishyescallbackGets called when the animation is finished() => { console.log('Done typing') }
showCaretyesbooleanShould the caret be shown?truefalse
getCaretRefyescallbackReturns the reference to the React component(ref) => { console.log(ref) }
loopyesbooleanShould the animation loop?falsetrue
loopIntervalMSyesnumberTime between end of animation and start of next loop in milliseconds2000500
replayyesbooleanReplay loop? (Change to false in onStart for best results)falsetrue
startInstantlyyesbooleanShould the animation begin instantly?falsetrue

License

MIT © Thomva