components / lyrics

lyrics.

time-synced lyrics with the current line lit and the rest receding. shares playhead's clock, so lines advance between polls; auto-scroll centres the active line and stands down for eight seconds after you scroll by hand. ships parseLrc() for .lrc sheets, and renders unsynced lyrics as a plain sheet.

synced — clicking a line seeks

scroll the box by hand and auto-scroll stands down for eight seconds.

installation
bunx @justin06lee/chrome@latest add lyrics
props
nametypedefaultdescription
lines *LyricLine[]-{ time?: number; text: string }[] — time in seconds; omit it on every line for an unsynced sheet. parseLrc() builds these from .lrc.
positionnumber0last known playback position in seconds.
startedAtnumber | Date-wall-clock ms at which position was true — the line then advances on its own.
playingbooleantrue
onSeek(seconds: number) => void-click a line to jump to its timestamp.
autoScrollbooleantruescroll the active line into view.
heightnumber | 'auto'280height of the scroll box in px.
align'left' | 'center''left'
emptyReactNode-rendered when lines is empty.
classNamestring-