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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yahiaaljanabi/autotype

v1.0.3

Published

Angular autotype directive with customizable caret

Readme

🎯 Angular Autotype

A lightweight Angular directive that creates smooth typewriter effects with a realistic blinking caret - perfect for hero sections, loading messages, and dynamic text displays.

npm version npm downloads license

✨ Features

  • 🎬 Smooth typewriter animation - Types and deletes text naturally
  • 💫 Realistic blinking caret - CSS-powered animation that looks like real cursors
  • ⚙️ Fully customizable - Control speeds, pauses, and caret appearance
  • 🚀 Performance optimized - Uses CSS animations and efficient DOM updates
  • 📱 Mobile friendly - Works perfectly on all devices
  • 🎯 Angular 19+ ready - Built with latest Angular standards
  • 📦 Lightweight - Minimal bundle size impact

📦 Installation

npm install @yahiaaljanabi/autotype

🚀 Quick Start

Step 1: Import the directive

import { Component } from "@angular/core";
import { AutotypeDirective } from "@yahiaaljanabi/autotype";

@Component({
  selector: "app-demo",
  standalone: true,
  imports: [AutotypeDirective], // 👈 Add this
  template: ` <h1 [libAutotype]="messages"></h1> `,
})
export class DemoComponent {
  messages = [
    "Hello World!",
    "Welcome to Angular!",
    "Start building amazing apps!",
  ];
}

Step 2: Use in your template

<div [libAutotype]="['First message', 'Second message', 'Third message']"></div>

That's it! 🎉 Your typewriter effect is ready.

📖 Examples

🎬 Basic Typewriter Effect

<h1
  [libAutotype]="['Hello Developer!', 'Welcome to our app!', 'Let\\'s build something great!']"
></h1>

⚡ Fast Typing with Custom Caret

<p
  [libAutotype]="['Typing really fast...', 'And deleting even faster!']"
  [typingSpeed]="30"
  [backspaceSpeed]="20"
  [caret]="'▌'"
></p>

🎯 Hero Section Example

<div class="hero">
  <h1>
    I am a
    <span
      [libAutotype]="['Developer', 'Designer', 'Creator', 'Problem Solver']"
      [typingSpeed]="80"
      [caret]="'|'"
      class="highlight"
    >
    </span>
  </h1>
</div>

🔧 Loading Messages

<div
  [libAutotype]="['Loading...', 'Almost there...', 'Ready!']"
  [typingSpeed]="60"
  [pauseAfterTyping]="800"
  [enableBlinking]="true"
></div>

🎨 No Blinking Caret

<div
  [libAutotype]="['Static cursor example']"
  [enableBlinking]="false"
  [caret]="'_'"
></div>

📱 Terminal Style

<div class="terminal">
  <span class="prompt">$ </span>
  <span
    [libAutotype]="['ls -la', 'cd projects', 'npm start', 'code .']"
    [typingSpeed]="100"
    [caret]="'█'"
    [pauseAfterTyping]="1500"
  >
  </span>
</div>

⚙️ Configuration Options

| Property | Type | Default | Description | | --------------------- | ---------- | ------- | --------------------------------------------------- | ----------------------------------- | | libAutotype | string[] | [] | Required - Array of strings to cycle through | | caret | string | ' | ' | Character used as the typing cursor | | typingSpeed | number | 100 | Milliseconds between each character when typing | | backspaceSpeed | number | 50 | Milliseconds between each character when deleting | | pauseAfterTyping | number | 1000 | How long to wait after finishing typing (ms) | | pauseAfterBackspace | number | 500 | How long to wait after deleting all text (ms) | | enableBlinking | boolean | true | Whether the caret should blink (uses CSS animation) |

🎨 Styling Tips

Custom Caret Styles

/* Make caret more visible */
.my-autotype .autotype-caret {
  color: #ff6b6b;
  font-weight: bold;
}

/* Different blink speed */
.my-autotype .autotype-caret {
  animation: autotype-blink 0.5s infinite;
}

Highlight Effect

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

🛠️ Advanced Usage

Dynamic String Updates

export class DynamicComponent {
  messages = ["Initial message"];

  updateMessages() {
    this.messages = ["New message", "Updated content", "Fresh text!"];
  }
}

Conditional Autotype

<div
  *ngIf="showTypewriter"
  [libAutotype]="messages"
  [typingSpeed]="speed"
></div>

🔧 Troubleshooting

Common Issues

Q: The text doesn't appear

// ✅ Make sure you import the directive
imports: // ✅ Provide an array of strings
[AutotypeDirective][libAutotype] = "['Hello']"; // Not just "Hello"

Q: Caret doesn't blink

<!-- ✅ Make sure blinking is enabled -->
<div [libAutotype]="messages" [enableBlinking]="true"></div>

Q: Animation is too fast/slow

<!-- ✅ Adjust speeds to your preference -->
<div [libAutotype]="messages" [typingSpeed]="200" <!-- Slower typing -->
  [backspaceSpeed]="100">
  <!-- Slower deleting -->
</div>

🤝 Contributing

Found a bug or want to contribute?

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

📄 License

MIT © Yahia Aljanabi


Made with ❤️ for the Angular community

Report Issues | Request Features