maxeth / react-type-animation

A React typewriter animation based on typical with extended functionality and customization.
https://react-type-animation.netlify.app/
MIT License
353 stars 25 forks source link

Pause after deletion and before next string? #21

Closed Toshinaki closed 1 year ago

Toshinaki commented 1 year ago

Currently after one string is deleted, and the next string got typed immediately.

Any way to pause for a given seconds before typing next string?

maxeth commented 1 year ago

You can put any number inside the sequence which represents the amount of milliseconds to be awaited before typing the next string, so you could do something like this if I understand correctly:

  sequence={[
        'One', 
        1000, 
        '', // Delete current typed-out string
        1000, // Wait 1 second before typing next string
        'Two', 
      ]}
Toshinaki commented 1 year ago

OK, it worked.

Thank you!