Skip to content

NickBoyadjian/typewriter-react

Repository files navigation

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

Name Type Description
input Array Input 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.
speed Int Speed is an integer for how many milliseconds each step takes.
cursor Boolean Determines whether or not to display a blinking cursor.
cursorChar String The string used for the cursor. Defaults to "|".

License

MIT © nickboyadjian

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published