Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Track List

ProNew

The tracks of a release. Each row's number is its play button, turning into moving bars while that track plays, with a line of progress under the current one.

Installation

pnpm dlx shadcn@latest add @viewport/track-list

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
tracks*Track[]—
currentstring | null

The track that is loaded, and whether it is playing.

—
playingbooleanfalse
progressnumber

How far through the current track playback is, from 0 to 1.

0
onPlayChange(id: string, playing: boolean) => void

Called with the track and whether it should play.

—
labelstring

Accessible name, e.g. the release's title.

"Tracks"
classNamestring—

Accessibility

  • An ordered list; each play button is named with its track and reports whether it is playing.
  • The play icon appears on focus as well as on hover.
  • Explicit is a letter with hidden text, not color alone.
  • The bars stand still under reduced motion.