TrackList
The track table of an album, a playlist or an artist's top songs.
| # | Title | Album | Date added | Duration | Title |
|---|---|---|---|---|---|
| 1 | Last Train BloomNeon Orchard | Midnight Citrus | Yesterday | 4:02 | |
| 2 | Contour LinesVelvet Cartography | Maps in the Dark | Yesterday | 3:47 | |
| 3 | Last CrossingNight Ferry | Harbor Lights | 3 days ago | 4:31 | |
| 4 | Orange StreetlightsENeon Orchard | Midnight Citrus | 6 days ago | 3:14 |
View code
<TrackList labels={labels} columns={{ album: true, added: true }}>
<TrackList.Row
index={1}
title="Last Train Bloom"
artists={<a href="/artist/neon-orchard">Neon Orchard</a>}
album={<a href="/album/midnight-citrus">Midnight Citrus</a>}
added="Yesterday"
duration={242}
play={<TrackList.PlayButton aria-label="Play Last Train Bloom" />}
/>
</TrackList>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { TrackList } from "@sdxc/ui/audio";Renders the table. Its cells drop to number, title and length on a narrow container, and the whole row plays its track when pressed anywhere outside its own links and controls.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
labels | Labels | Yes | |
columns | Columns | No | |
header | boolean | No | Shows the heading row from the width where every column fits. @default true |
children | RemixNode | Yes | TrackList.Row elements in playing order. |
Also accepts everything in TagProps<"table">.