1.1.2 • Published 1 year ago

react-typing-dynamics v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

React Typing Dynamics

A simple and customizable React component for simulating typing animations.

NPM Package: npm.io

Installation

Using npm:

npm install react-typing-dynamics

Using yarn:

yarn add react-typing-dynamics

How to use

Here's a basic example of how to use the TextAnimation component from react-typing-dynamics:

import React from 'react';
import TextAnimation from 'react-typing-dynamics';

const App = () => {
  const phrases = ['Hello, World!', '<h1>Welcome to my website.</h1>', 'Enjoy your stay!'];

  return (
    <TextAnimation
      phrases={phrases}
      typingSpeed={200}
      backspaceDelay={50}
      eraseDelay={1000}
      timeComplete={3000}
      errorProbability={0.1}
      isSecure={true}
    />
  );
};

export default App;

Props

Prop NameTypeDescription
phrasesstring[]An array of phrases to be typed. Can be HTML or String
typingSpeednumberThe typing speed in characters per second.
backspaceDelaynumberThe delay in milliseconds before the text starts to be erased.
eraseDelaynumberThe delay in milliseconds between each character erasing.
timeCompletenumberThe delay in milliseconds before the typing animation restarts.
errorProbabilitynumberThe probability (between 0 and 1) of a typing error happening.
isSecurebooleanIf true, the text is sanitized with sanitize-html.
eraseOnCompletebooleanIf true, the text is deleted when finish writing.

License

This project is licensed under the MIT License - see the LICENSE file for details.
1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago