Typewriter Widget

The Typewriter Widget creates a realistic typewriter effect that types out text character by character with a blinking cursor. It's perfect for creating engaging, dynamic text animations that draw attention and add personality to your videos.

Basic Usage

<div data-type="typewriter" 
     data-duration-animation="5" 
     data-start="2"
     class="text-3xl font-mono text-green-600">
  This text will be typed out character by character
</div>

Attributes

Attribute
Type
Default
Description

data-type

string

-

Must be "typewriter"

data-duration-animation

number

3

How long typing takes in seconds

data-start

number

0

When typing starts in seconds

Animation Behavior

Typing Effect

The typewriter widget creates a realistic typing animation:

  • Before start: No text visible, no cursor

  • During animation: Text appears character by character with blinking cursor

  • After animation: Full text visible, cursor disappears

Cursor Behavior

  • During typing: Blinking cursor appears after the last typed character

  • Cursor style: Vertical line (|) that blinks every 1 second

  • After completion: Cursor disappears completely

Examples

Simple Typewriter Effect

Multiple Typewriter Messages

Code-Style Typewriter

Styling Options

Font Families

Text Sizes

Colors

Animation Timing

Fast Typing (2 seconds)

Slow Typing (8 seconds)

Delayed Start

Common Use Cases

Terminal/Code Interface

Storytelling

Status Updates

Best Practices

Timing Guidelines

Text Length
Recommended Duration
Use Case

Short (1-10 words)

2-3 seconds

Quick messages

Medium (10-25 words)

4-6 seconds

Standard content

Long (25+ words)

6-10 seconds

Detailed messages

Content Tips

  • Keep it readable: Don't make text too long for a single typewriter effect

  • Break up long content: Use multiple typewriter widgets for long messages

  • Use appropriate fonts: Monospace fonts work best for the typewriter effect

  • Consider context: Match the typing speed to the message's urgency

Visual Design

  • Terminal aesthetic: Use green text on black background for code/terminal feel

  • High contrast: Ensure good readability with contrasting colors

  • Consistent spacing: Use proper line spacing for multiple messages

  • Font choice: Monospace fonts enhance the typewriter effect

Advanced Techniques

Sequential Messages

Mixed with Other Widgets

Troubleshooting

Text Not Typing

Problem: Typewriter effect doesn't work

Solutions:

  • Check that data-type="typewriter" is set correctly

  • Verify the element has text content inside

  • Make sure data-start time is reasonable

  • Ensure data-duration-animation is set

Typing Too Fast/Slow

Problem: Animation speed doesn't feel right

Solutions:

  • Adjust data-duration-animation value

  • Longer duration = slower typing

  • Shorter duration = faster typing

  • Consider the length of your text

Cursor Not Showing

Problem: No blinking cursor appears

Solutions:

  • This is normal behavior - cursor only shows during typing

  • Cursor disappears after animation completes

  • Check that the animation is actually running

Text Overlapping

Problem: Multiple typewriter elements overlap

Solutions:

  • Use different positioning classes

  • Space out the data-start times

  • Use different vertical positions

  • Add margins between elements


Last updated