New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-use-typewriter

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-use-typewriter

Typewriter effect hook for react

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

React Typewriter effect hook

Getting Started

npm install --save react-use-typewriter

Or

yarn add react-use-typewriter

Usage Example

import useTypewriter from "react-use-typewriter";

const Example = () => {
  const words = ["react", "typescript", "nodejs"];
  const currentWord = useTypewriter({words});

  return (
    <div>
      {currentWord}
      <span className="cursor">|</span>
    </div>
  );
}

Options

NameTypeDefault valueDescription
wordsArraynullRequired, words for typing
typeSpeednumber100Speed in ms for each letter to type
afterTypingDelaynumber1000Delay in ms after typing has finished
eraseWordsbooleantrueWhether or not to erase after typing
eraseSpeednumber50Speed in ms for each letter to erase
afterErasingDelaynumber1000Delay in ms after erasing has finished

CSS for blinking cursor

Blinking cursor is not included but can be implemented easily with CSS:

@keyframes blink {
  from, to {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.cursor {
  animation: blink 1s linear infinite forwards;
}

FAQs

Package last updated on 06 Sep 2022

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