An auto typer component for react.
npm install react-auto-typerA lightweight auto-typer React component.
 
``bash`
npm install --save react-auto-typer
The package exports a named component AutoTyper.
`jsx
import React from 'react'
import { AutoTyper } from 'react-auto-typer'
function Example() {
return (
delay={100} // optional, defaults to 100
styleClass='autotyper' // optional CSS class applied to the
repeat={false} // optional, whether to restart typing after completion
onlyOnce={false} // optional, if true, calls onComplete and stops
onComplete={() => console.log('typing complete')} // optional callback
/>
)
}
`
- text (string, required): Text to auto type.delay
- (number, optional): Delay between typing steps in milliseconds. Defaults to 100.styleClass
- (string, optional): CSS class applied to the wrapping
element.repeat
- (boolean, optional): If true, typing restarts after reaching the end. Default false.onlyOnce
- (boolean, optional): If true, the component will call onComplete once and stop the interval.onComplete
- (function, optional): Callback invoked once when typing completes (used when onlyOnce` is true).
Apache-2.0 © trishantpahwa