Discography timeline — Media block
Promedia-discography-timeline · for home, landing pages
Discography timeline
Releases grouped by year down the page, each with its tracklist in view: a long career or a label’s history read in order; the merchant’s own only
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/media-discography-timelineUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import MediaDiscographyTimeline from '@/components/trame/blocks/media/media-discography-timeline.vue'
const props = {
title: "Maelle Roque’s records",
lead: "Ten years of songs recorded in a small studio, from the first album to the live sessions.",
releases: [
{
id: "r-12",
title: "Low Tides",
year: "2025",
kind: "album",
cover: "https://images.unsplash.com/photo-1616714109948-c74fe5029a4d?w=1600&q=80",
alt: "An amber vinyl record spinning on a turntable, the tonearm down",
listen: "release-listen",
formats: [
{
label: "Vinyl",
action: "release-buy",
record: {
format: "vinyl"
}
},
{
label: "CD",
action: "release-buy",
record: {
format: "cd"
}
}
],
tracks: [
{
title: "Harbor at Night",
duration: "3:12"
},
{
title: "The Dark Lighthouses",
duration: "4:05"
}
]
},
{
id: "r-11",
title: "The Hall Sessions",
year: "2025",
kind: "live",
cover: "https://images.unsplash.com/photo-1603048588665-791ca8aea617?w=1600&q=80",
alt: "A black record spinning, seen from above, with its silver tonearm",
listen: "release-listen",
formats: [
{
label: "CD",
action: "release-buy",
record: {
format: "cd"
}
},
{
label: "Digital",
action: "release-buy",
record: {
format: "digital"
}
}
],
tracks: [
{
title: "Salt (Hall version)",
duration: "3:12"
},
{
title: "Harbor at Night (Hall version)",
duration: "4:05"
}
]
}
]
}
</script>
<template>
<MediaDiscographyTimeline v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title | string | Wordsthe section’s heading |
| lead | string | Wordsone or two lines under the heading |
| releases* | Release[] | Datathe releases, newest first, as the artist or label publishes them |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Release releases[] · 9 props
| Prop | Type | Description |
|---|---|---|
| id* | string | Designthe release’s identifier, unique in the list |
| title* | string | Wordsthe release’s title |
| year* | string | Wordsits year as written ("2024"), never computed |
| kind* | 'album' | 'ep' | 'single' | 'live' | what kind of release it is: album, ep, single, live |
| cover | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the cover shows, when the title does not say it |
| tracks | Track[] | the tracklist in order, if the artist publishes it |
| formats | Format[] | the formats on sale; none when the release is not sold |
| listen | string | Actionthe page where the release is heard (the artist’s player or a platform) |
Track releases[].tracks[] · 2 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe title as the artist wrote it |
| duration | string | Wordsits length as the artist wrote it ("3:42"), never computed |
Format releases[].formats[] · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe format on sale ("Vinyl", "CD", "Digital"): only those the merchant really sells |
| action* | string | Actionthe page where this format is bought |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| asset | a picture’s address as your app serves it |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- Expressive motion, within its budget; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
releases[].formats[],releases[].listen - Reads
releasesfrom your app
A media section, for home, landing pages; it uses @lucide/vue, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More media blocks
- Episode clips rails: short episodes or clips in horizontal rails grouped by theme: a video series or a show with highlights; the merchant’s own only.
- Episode transcript tabs: one episode: its player, a summary and a transcript in tabs, platforms, previous and next: the page of an episode; the merchant’s own only.
- Film introduction split: the poster beside its summary, key points and action: a product or episode introduction; the merchant’s own only.
- Film preview lightbox: a small poster tile that opens the film in a dialog: a secondary film that must not take the page; the merchant’s own only.
- Film transcript split: the poster, its summary and the words of the film in a scrolling transcript: a film that must be readable and searchable; the merchant’s own only.
- Podcast featured grid: one episode large on a dark panel, the recent ones as cards with guest, date and length: a show with a face and a few episodes; the merchant’s own only.
- Podcast rows: numbered hairline rows with title, summary, date and length, readable without pictures: a long archive; the merchant’s own only.
- Song lyrics and credits: Author supplied lyrics beside their story and credits; the merchant’s own only.