Text
StreamText
Simulates LLM token-by-token streaming output with character or word-by-word display.
Installation
npm install @ai-animate/core
Usage
import { StreamText } from '@ai-animate/core'
<StreamText text="Building the future of AI..." mode="char" speed={40} />
Props
textstring—Full text to stream (required)
mode'char' | 'word''char'Streaming mode: character or word
speednumber40Speed of appearance in milliseconds per char or word
holdMsnumber1500Time cursor blinks after text is complete in ms
cursorCharstring'▋'Character to use as cursor
cursorColorstring'#00ff00'Color of cursor
fontSizestring'clamp(1rem, 2vw, 1.25rem)'Font size
colorstring'#ffffff'Text color
loopbooleanfalseWhether to loop the animation
classNamestringundefinedAdditional CSS class