Calm motion: animations on this site only fade, with no movement
Chapter list
The chapters of an episode, with the current one marked
Shows the parts of a long episode or video, with the start and the length of each part. A click on a chapter plays from its start. For the words of the episode, use the transcript.
Basic
chaptersis a list of chapters. Each chapter has astartin seconds and atitle. A chapter lasts until the next one starts.timeis the time of the media now, in seconds.durationis the length of the media, and it gives the last chapter its length.- A click on a chapter emits
seekwith its start. Set thecurrentTimeof your media to it. - The current chapter is bold, with a filled number and a line under it that grows as the chapter plays.
- The list is a navigation landmark, and the current chapter has
aria-current. Change the words withlabelsor a label pack:title, andlength(a function of the minutes).
Usage
ts
import { BlessChapterList } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
chapters* | BlessChapter[] | — | |
time | number | 0 | the time of the media now, in seconds |
duration | number | — | the length of the media, in seconds; it gives the last chapter its length |
labels | Partial<{ title: string; length: (minutes: number) => string; }> | — |
Events
| Name | Payload | Description |
|---|---|---|
seek | [seconds: number] |