Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-typing-animation

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-typing-animation

[![npm version](https://img.shields.io/npm/v/react-typing-animation.svg)](https://npm.im/react-typing-animation) ![Licence](https://img.shields.io/npm/l/react-typing-animation.svg)

  • 1.6.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
328
decreased by-21.15%
Maintainers
1
Weekly downloads
 
Created
Source

React-typing-animation

npm version Licence

A fully-featured typing animation in React that supports any valid JSX.

Motivation

There were other JS typing animations that existed when I created this, but they were all lacking in robust features. This component aims to support all of the following features:

✅ Type text from any valid JSX

✅ Preserve DOM structure/styling

✅ Change typing speed anywhere in tree

✅ Add a delay anywhere in tree

✅ Backspace animation

✅ Reset lines / full tree

✅ Loop functionality

✅ No dependencies (CSS or JS)

Demo

View the live demo

or

git clone https://github.com/adamjking3/react-typing-animation
cd react-typing-animation
npm install
npm start

Then open http://localhost:3000/ in a browser.

Feature requests and pull requests welcome

Installation

npm i --save react-typing-animation

Usage

import Typing from 'react-typing-animation';

const AnimatedTypingComponent = () => (
  <Typing>
    <span>This span will get typed.</span>
  </Typing>
);

Documentation

PropertyTypeDefaultRequired
childrenReact nodeyes
classNamestringno
cursorClassNamestringno
cursorReact node<Cursor />no
hideCursorbooleanfalseno
speednumber50 (ms)no
startDelaynumber0 (ms)no
loopbooleanfalseno
onStartedTypingfunction() => {}no
onBeforeTypefunction() => {}no
onAfterTypefunction() => {}no
onFinishedTypingfunction() => {}no

Backspace Component

import Typing from 'react-typing-animation';
...
  <Typing>
    <span>This span will get typed, then erased.</span>
    <Typing.Backspace count={20} />
  </Typing>
PropertyTypeDefaultRequiredDescription
countnumber1false
delaynumber0false
speednumber-1false

Delay Component

import Typing from 'react-typing-animation';
...
  <Typing>
    <div>
      There will be a 1000ms delay here,
      <Typing.Delay ms={1000} />
      then this will be typed.
    </div>
  </Typing>
PropertyTypeDefaultRequiredDescription
msnumberyes

Speed Component

import Typing from 'react-typing-animation';
...
  <Typing speed={50}>
    This line will be typed at 50ms/character,
    <Typing.Speed ms={200} />
    then this will be typed at 200ms/character.
  </Typing>
PropertyTypeDefaultRequiredDescription
msnumberyes

Reset Component

import Typing from 'react-typing-animation';
...
  <Typing>
    <span>This line will stay.</span>
    <span>This line will get instantly removed after a 500 ms delay</span>
    <Typing.Reset count={1} delay={500} />
  </Typing>
PropertyTypeDefaultRequiredDescription
countnumber0false
delaynumber0false
speednumber-1false

Contributing

After cloning the repository and running npm install inside, you can use the following commands to develop and build the project.

# Starts a webpack dev server that hosts the demo at http://localhost:3000
npm start

# Lints the code with eslint
npm run lint

# Lints and builds the code, placing the result in the dist directory.
npm run build

Pull requests are welcome!

License

MIT

Keywords

FAQs

Package last updated on 24 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc