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

react-typing-hook

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-typing-hook

Animated typing in ~400 bytes 🐡 of React Hook.

latest
Source
npmnpm
Version
1.0.10
Version published
Weekly downloads
20
566.67%
Maintainers
1
Weekly downloads
 
Created
Source

react-typing-hook

Animated typing in ~400 bytes 🐡 of React Hook.

Storybook lerna GitHub GitHub Workflow Status (branch)

Install

yarn add react-typing-hook

or

npm install react-typing-hook

Usage

Type some animate text on the web.

import useTyping from 'react-typing-hook'

function App() {

  const ref = React.useRef(null);
  
  useTyping(ref, {
    steps: ['Hello', 1000, 'Hello world!', 500],
    loop: Infinity,
    speed: 60
  })
  
  return <p ref={ref}></p>
  // <p>Hello</p>
  // ... 1000ms
  // <p>Hello Hello</p>
  // ... 500ms
  // <p>Hello</p>
}

API

NameTypeDefaultDescription
refReact.RefObject<HTMLDocument>-The ref of typical text wraper
stepsArray<string, number, Function>-Step array assign to the typing
loopnumber1The number of loop typing animation effect, Infinity
speednumber60The speed of typing animation effect

Add the classname on the dom.

<p ref={ref} className="typingWrapper"></p>

Such as a blink cursor style like this.

.typingWrapper::after {
  content: "|";
  animation: blink 1s infinite step-start;
}

@keyframes blink {
  50% { opacity: 0; }
}

Contributing

yarn install

Compiles and hot-reloads for development

yarn start

Compiles and minifies for production

yarn build

LICENSE

MIT

Keywords

react

FAQs

Package last updated on 22 Nov 2020

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