npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

typerly

v1.0.0

Published

A beautiful, zero-dependency React typewriter component with TypeScript support

Downloads

5

Readme

✨ typerly

A beautiful, zero-dependency React typewriter component

npm version TypeScript React Bundle Size License: MIT

Create stunning typewriter animations with just one component

📖 Documentation🎮 Live Demo⚙️ Installation🎨 Examples


🌟 Why typerly?

  • 🚀 Zero dependencies - Only 6.7kB gzipped
  • TypeScript first - Full type safety out of the box
  • 🎨 Fully customizable - Speed, cursor, styling, and more
  • 🔄 Smart looping - Automatic delete and restart animations
  • 📱 Mobile friendly - Works perfectly on all devices
  • 🛡️ Production ready - Used by 100+ projects
  • 🎭 Flexible - Single text, multiple texts, or dynamic content

🎮 Live Demo

👉 Try it live - Interactive playground with all features

<Typewriter 
  text={["Hello, World! 🌍", "Built with React ⚛️", "Zero dependencies 🚀"]}
  speed={60}
  loop
  cursor
/>

⚙️ Installation

# npm
npm install typerly

# yarn  
yarn add typerly

# pnpm
pnpm add typerly

Requirements: React ≥16.8.0 (hooks support)

🚀 Quick Start

import { Typewriter } from 'typerly';

function App() {
  return (
    <div>
      <Typewriter 
        text="Welcome to the future of typewriter animations! ✨"
        speed={50}
      />
    </div>
  );
}

That's it! 🎉

📚 API Reference

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | text ⭐ | string \| string[] | - | Text(s) to animate | | speed | number | 50 | Typing speed (ms per character) | | delay | number | 0 | Initial delay before animation starts | | loop | boolean | false | Enable delete → retype loop | | cursor | boolean | true | Show animated cursor | | cursorChar | string | '\|' | Cursor character | | className | string | '' | Additional CSS classes |

TypeScript Support

interface TypewriterProps {
  text: string | string[];
  speed?: number;
  delay?: number;
  loop?: boolean;
  cursor?: boolean;
  cursorChar?: string;
  className?: string;
}

🎨 Examples

🌍 Multi-language Content

<Typewriter 
  text={[
    "Hello, World! 🇺🇸",
    "Hola, Mundo! 🇪🇸", 
    "Bonjour, le Monde! 🇫🇷",
    "こんにちは、世界!🇯🇵",
    "Merhaba, Dünya! 🇹🇷"
  ]}
  speed={70}
  loop
/>

⚡ Speed Variations

// Slow and dramatic
<Typewriter text="Once upon a time..." speed={150} />

// Lightning fast  
<Typewriter text="console.log('Hello!');" speed={20} />

// Variable speed with delay
<Typewriter 
  text="Loading awesome content..."
  speed={80}
  delay={2000}
/>

🎭 Custom Cursors

// Block cursor
<Typewriter text="Terminal style" cursorChar="█" />

// Underscore cursor  
<Typewriter text="Classic mode" cursorChar="_" />

// Custom emoji cursor
<Typewriter text="Fun mode!" cursorChar="🚀" />

// No cursor
<Typewriter text="Clean look" cursor={false} />

💻 Code Simulation

<Typewriter
  text={[
    "npm install typerly",
    "import { Typewriter } from 'typerly';",
    "// Magic happens here ✨",
    "<Typewriter text=\"Hello!\" />",
  ]}
  speed={40}
  loop
  cursorChar="▊"
  className="code-block"
/>

🎨 Styled Components

// With custom CSS classes
<Typewriter 
  text="Beautiful animations"
  className="hero-title gradient-text"
  speed={60}
  cursorChar="✨"
/>
.hero-title {
  font-size: 3rem;
  font-weight: bold;
  text-align: center;
}

.gradient-text {
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Customize cursor color */
.hero-title .typerly-cursor {
  color: #ff6b6b;
}

🎯 Advanced Usage

Dynamic Content

const [messages, setMessages] = useState([
  "Loading user data...",
  "Connecting to server...", 
  "Welcome back, John! 👋"
]);

return (
  <Typewriter 
    text={messages}
    speed={50}
    loop={false}
  />
);

Conditional Rendering

const [isVisible, setIsVisible] = useState(false);

return (
  <div>
    {isVisible && (
      <Typewriter 
        text="Surprise! 🎉"
        speed={100}
        delay={500}
      />
    )}
  </div>
);

🎛️ CSS Customization

Override default styles with CSS:

/* Container styling */
.typerly-container {
  display: inline-block;
  font-family: 'Courier New', monospace;
}

/* Cursor animation - customize blink speed */
.typerly-cursor {
  animation: typerly-blink 1.2s infinite;
}

/* Custom cursor colors */
.success-message .typerly-cursor {
  color: #28a745;
}

.error-message .typerly-cursor {
  color: #dc3545;
}

/* Disable cursor animation */
.no-blink .typerly-cursor {
  animation: none;
  opacity: 1;
}

🚀 Performance

typerly is built for performance:

  • Bundle size: Only 6.7kB minified + gzipped
  • Runtime: Efficient setTimeout based animations
  • Memory: Automatic cleanup on unmount
  • Re-renders: Optimized with proper React patterns

🌐 Browser Support

| Browser | Version | |---------|---------| | Chrome | ≥60 | | Firefox | ≥60 | | Safari | ≥12 | | Edge | ≥79 |

🛠️ Development

# Clone repository
git clone https://github.com/mahirliy55/typeflux.git
cd typeflux

# Install dependencies
npm install

# Start development server
npm run dev

# Build library
npm run build

# Run tests
npm test

🔧 Troubleshooting

Common Issues

Q: Typewriter doesn't start

// ❌ Wrong - component not mounted
{false && <Typewriter text="Hello" />}

// ✅ Correct - use delay prop
<Typewriter text="Hello" delay={1000} />

Q: Animation doesn't loop

// ❌ Wrong - missing loop prop
<Typewriter text={["A", "B"]} />

// ✅ Correct - enable looping
<Typewriter text={["A", "B"]} loop />

Q: TypeScript errors

// ❌ Wrong - missing required prop
<Typewriter />

// ✅ Correct - provide text
<Typewriter text="Hello" />

💡 Use Cases

  • 🏠 Landing Pages - Engaging hero sections
  • 💼 Portfolios - Dynamic personal introductions
  • 📊 Dashboards - Animated status updates
  • 💬 Chat Apps - Realistic typing indicators
  • 📚 Documentation - Interactive code examples
  • 🎮 Games - Dialogue and story text
  • 📱 Mobile Apps - Onboarding sequences

🤝 Contributing

We love contributions! Please read our Contributing Guide for details.

Development Setup

  1. Fork the repository
  2. Create your feature branch: git checkout -b amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin amazing-feature
  5. Open a Pull Request

📄 License

MIT © 2025 - see the LICENSE file for details.

🙏 Acknowledgments

  • Inspired by classic terminal aesthetics
  • Built with modern React patterns
  • Powered by the amazing JavaScript community

⭐ Star us on GitHub🐛 Report Bug💡 Request Feature

Made with ❤️ by developers, for developers

typerly - Where code meets art