LyricsView

Time-synced lyrics. The line being sung is large and sharp, the rest fade and blur with distance, the list glides to keep it centred, and pressing a line seeks to it. Media.

Open playground

About

LyricsView is a React component in the Media category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { LyricsView } from "@ashutoshswamy/smoui" and set lines, currentTime, onSeek among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { LyricsView } from "@ashutoshswamy/smoui";

<LyricsView lines={[{ time: 0, text: "First line" }, { time: 4, text: "Second line" }]} currentTime={time} onSeek={seek} />

Props 4

lines

Start time in seconds and the text of each line.

{ time: number; text: string }[]
currentTime

Playhead in seconds.

number
onSeek

A line was pressed.

(seconds: number) => void
height

Height of the scrolling area.

numberdefault 320