
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
text-animator
Advanced tools
A simple and lightweight JavaScript Typewriter effect library for animating typing of multiple words or phrases sequentially.
destroy() method to stop the animation and clean up timersnpm install text-animator
import React, { useEffect, useRef } from "react";
import Typewriter from "text-animator";
const TypewriterComponent = () => {
const elementRef = useRef(null);
const words = [
"Type what you want to build here...",
"Enter your prompt here...",
"Describe what you want to build...",
];
useEffect(() => {
const typewriter = new Typewriter(elementRef.current, words, {
typingSpeed: 40,
pauseTime: 500,
});
return () => typewriter.destroy();
}, []);
return <div ref={elementRef} style={{ fontFamily: "monospace", fontSize: 20 }} />;
};
export default TypewriterComponent;
import Typewriter from "text-animator";
const element = document.getElementById("typewriter");
const words = [
"Type what you want to build here...",
"Enter your prompt here...",
"Describe what you want to build..."
];
const typewriter = new Typewriter(element, words, {
typingSpeed: 40,
pauseTime: 500,
});
<div id="typewriter"></div>
import { useEffect, useRef } from "react";
import Typewriter from "text-animator";
export default function Home() {
const elementRef = useRef(null);
const words = [
"Type what you want to build here...",
"Enter your prompt here...",
"Describe what you want to build...",
];
useEffect(() => {
const typewriter = new Typewriter(elementRef.current, words, {
typingSpeed: 40,
pauseTime: 500,
});
return () => typewriter.destroy();
}, []);
return (
<main>
<h1>Next.js Typewriter Example</h1>
<div ref={elementRef} style={{ fontFamily: "monospace", fontSize: 20 }} />
</main>
);
}
<template>
<div ref="typewriter" class="typewriter-text"></div>
</template>
<script setup>
import { ref, onMounted, onBeforeUnmount } from "vue";
import Typewriter from "text-animator";
const typewriter = ref(null);
const words = [
"Type what you want to build here...",
"Enter your prompt here...",
"Describe what you want to build...",
];
let typewriterInstance = null;
onMounted(() => {
typewriterInstance = new Typewriter(typewriter.value, words, {
typingSpeed: 40,
pauseTime: 500,
});
});
onBeforeUnmount(() => {
if (typewriterInstance) {
typewriterInstance.destroy();
}
});
</script>
<!DOCTYPE html>
<html>
<head>
<title>Typewriter Demo</title>
</head>
<body>
<div id="output"></div>
<script type="module">
import Typewriter from 'text-animator';
const element = document.getElementById('output');
const words = [
"Type what you want to build here...",
"Enter your prompt here...",
"Describe what you want to build..."
];
const typewriter = new Typewriter(element, words, {
typingSpeed: 40,
pauseTime: 500
});
// Optional: Stop it later if needed
// setTimeout(() => typewriter.destroy(), 10000);
</script>
</body>
</html>
MIT ©Pankaj Kumar
Pankaj Kumar pankaj.ky3007@gmail.com github.com/PankajKumar1947
FAQs
type writer effect animation
We found that text-animator demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.