
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
react-typing-hook
Advanced tools
Animated typing in ~400 bytes 🐡 of React Hook.
yarn add react-typing-hook
or
npm install react-typing-hook
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>
}
| Name | Type | Default | Description |
|---|---|---|---|
| ref | React.RefObject<HTMLDocument> | - | The ref of typical text wraper |
| steps | Array<string, number, Function> | - | Step array assign to the typing |
| loop | number | 1 | The number of loop typing animation effect, Infinity |
| speed | number | 60 | The 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; }
}
yarn install
Compiles and hot-reloads for development
yarn start
Compiles and minifies for production
yarn build
MIT
FAQs
Animated typing in ~400 bytes 🐡 of React Hook.
The npm package react-typing-hook receives a total of 7 weekly downloads. As such, react-typing-hook popularity was classified as not popular.
We found that react-typing-hook demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.