Text
SpeakerCaption
Animated subtitle bar with speaker badge and word-by-word highlight sync.
Installation
npm install @ai-animate/core
Usage
import { SpeakerCaption } from '@ai-animate/core'
<SpeakerCaption text="The future of AI is here" speaker="Host" />
Props
textstringThe future of AI is already here and it is incredibleText to display
speakerstringHostSpeaker name for the badge
speakerColorstring#6366f1Speaker badge background color
wordDelaynumber320Delay between word syncs in ms
holdMsnumber1200Hold time at end in ms
loopbooleantrueWhether to loop
fontSizestringclamp(1.1rem, 2.2vw, 1.6rem)Font size
colorstring#ffffffText color
highlightColorstring#ffffffActive word highlight color
dimColorstringrgba(255,255,255,0.35)Dim word color
backgroundstringrgba(0,0,0,0.82)Background color
onCycleComplete() => voidundefinedCalled when cycle completes