1.0.1 • Published 4 years ago

typewriter-react v1.0.1

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

typewriter-react

React component to simulate typing

NPM JavaScript Style Guide

Install

npm

npm install --save typewriter-react

yarn

yarn add typewriter-react

Usage

import React, { Component } from 'react'

import TypeWriter from 'typewriter-react'

class Example extends Component {
  render() {
    return <TypeWriter 
      input={[
        "Hello, world!",
        {"pause": 5}
        {"delete": 6},
        "World! 🤓"
      ]}
      
      speed={75}
      cursor={true}
      cursorChar="|"
    />
  }
}

Props

NameTypeDescription
inputArrayInput takes an array of steps to perform. Pass in strings for the text you want to print. If you want to pause, pass an object with a "pause" key, and a value of how many intervals you want to pause for. If you want to delete characters, pass in an object with a "delete" key and a value of how many characters you want to delete.
speedIntSpeed is an integer for how many milliseconds each step takes.
cursorBooleanDetermines whether or not to display a blinking cursor.
cursorCharStringThe string used for the cursor. Defaults to "|".

License

MIT © nickboyadjian