StellarUI

<stellar-typewriter>

typing animation with configurable timing, optional looping, viewport start, and a property-only restart hook.

Properties

Preview

Restart

Markup

Copy
<stellar-typewriter

  text="Ship the reset branch.
Keep the docs honest."
  with-cursor
  loop
>
</stellar-typewriter>

API

Complete props, events, slots, and implementation notes for the shipped typewriter surface.

Props

PropTypeDefaultNotes
textstring''The source text to type. Multiple lines are separated by delimiter.
delimiterstring\nSeparator for multiple lines inside text.
speednumber50Average milliseconds between typed characters.
delaynumber250Delay before the animation starts.
start-on-viewbooleanfalseStarts typing only after the component enters the viewport.
with-cursorbooleanfalseShows the blinking cursor while the animation is active.
loopbooleanfalseErases the finished line(s) and starts again.
loop-delaynumber2000Pause before erasing when looping.
pausebooleanfalsePauses typing or erasing at the current point.
ignore-reduced-motionbooleanfalseAllows the animation to run even when the user prefers reduced motion.
--cursor-colorCSS custom propertycurrentColorCursor color when with-cursor is enabled.
--cursor-widthCSS custom property1.5pxCursor thickness.

Events

EventSourceNotes
completestellar-typewriterFires each time a line finishes typing. In loop mode that means the event fires on every completed pass.

Slots

SlotNotes

Notes

  • The public tag is `stellar-typewriter`, matching the component's text-prop driven contract rather than a slotted rich-text surface.
  • The source text lives in the `text` prop. Multiple lines are split by `delimiter` and typed one line at a time.
  • `complete` fires whenever a line finishes typing, even when looping will immediately continue into erase-and-restart behavior.
  • The host exposes a property-only `restart()` method so callers can replay the animation without mutating the text or timing props.
  • When reduced motion is respected, the component still advances through the same line/loop flow, but it skips the character-by-character typing and erasing steps.