maxeth / react-type-animation

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

Feature request: ability to use HTML instead of text in a multiline animation #22

Open vincentteyssier opened 1 year ago

vincentteyssier commented 1 year ago

Great plugin! One use case of such a plugin is often to display someone writing code. We might want to style the text to represent tags, values, attributes, etc... differently. Or at least if too difficult it would be a great addition to be able to apply a distinct style to each line.

Thanks

maxeth commented 1 year ago

Hey,

this package was initially intended for simple text to keep the bundle size low.

You could maybe compose different animation components to make the illusion of multi-line typing like here https://github.com/maxeth/react-type-animation/issues/9#issuecomment-1242793790 but even then, you'd only be able to style all of the text inside the wrapper, which wouldn't allow you to granularly style the text as you described.

Instead, you could maybe check out this package: https://www.npmjs.com/package/react-typing-animation. It's a bit old and not actively updated, but from what I know it's capable of doing exactly what you're looking for (keep in mind that it has a ~10x larger bundle size).

But yes, you're right, we could fork the code from the above linked package, optimize/extend it and export it as a separate component from this package at some point in the future but that won't be a quickly-done task.

tomyedlp commented 10 months ago

Is there a possibility to update this?