Calm motion: animations on this site only fade, with no movement
Lyrics
The lines of a song that follow the playback
Shows the words of a song while it plays. For the words of a talk, with speakers, use the transcript.
Basic
Position: 14 s. Click a line to jump to it.
linesis a list of lines. Each line has thetimeit starts, in seconds, and itstext.positionis the place of the song now, in seconds. Give it from the time of your player.- The line that plays is bigger and full strength, and it has a bar in the accent color and
aria-current. - The box scrolls by itself to keep that line in the middle. Only the box scrolls, not the page. Under reduced motion, it jumps without a slide.
- Each line is a button that emits
seekwith its time. - The box is a region that the keyboard can reach and scroll.
- Change the words with
labelsor a label pack:titleandseek(a function).
Usage
ts
import { BlessLyrics } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
lines* | BlessLyricLine[] | — | |
position* | number | — | the place of the song now, in seconds |
labels | Partial<{ title: string; seek: (time: string) => string; }> | — |
Events
| Name | Payload | Description |
|---|---|---|
seek | [time: number] |