Media›Playlist

media

Playlist

Curated playlist with track listing for albums, podcasts, audiobooks, and mixes

Install

  1. Add the package: npm install @refrakt-md/media
  2. Add it to the plugins array in refrakt.config.json: "plugins": ["@refrakt-md/media"]

About the plugin and its runes

Source

import Markdoc from '@markdoc/markdoc';
import type { Node, RenderableTreeNode } from '@markdoc/markdoc';
import type { ResolvedContent } from '@refrakt-md/types';
const { Tag } = Markdoc;
import {
	createContentModelSchema,
	createComponentRenderable,
	renderNodes,
	pageSectionProperties,
	RenderableNodeCursor,
	SplitLayoutModel,
	buildLayoutMetas,
	extractMediaImage,
} from '@refrakt-md/runes';
import { parseDuration, formatDuration } from '../duration.js';
import { TYPE_IMPLICIT } from './track.js';

const playlistType = ['album', 'podcast', 'audiobook', 'series', 'mix'] as const;

const CHILD_KIND: Record<string, string> = {
	album: 'song',
	mix: 'song',
	podcast: 'episode',
	audiobook: 'chapter',
	series: 'episode',
};

const contentType = ['auto', 'lyrics', 'chapters'] as const;

const MUSIC_ITEM = {
	'track-name': 'name',
	artist: 'byArtist',
	duration: 'duration',
	date: 'datePublished',
	url: 'url',
	position: 'position',
} as const;

const SPOKEN_ITEM = {
	'track-name': 'name',
	duration: 'duration',
	date: 'datePublished',
	url: 'url',
	position: 'position',
} as const;

const musicRow = (type: string) => ({
	type,
	properties: { headline: 'name', mediaImage: 'image', artist: 'byArtist' },
	lists: ['track'],
	children: { track: { type: 'MusicRecording', property: 'track', properties: MUSIC_ITEM } },
});

const spokenRow = (type: string, itemType: string) => ({
	type,
	properties: { headline: 'name', mediaImage: 'image' },
	lists: ['hasPart'],
	children: { track: { type: itemType, property: 'hasPart', properties: SPOKEN_ITEM } },
});

export const playlistSchema = {
	by: 'type',
	rows: {
		album: musicRow('MusicAlbum'),
		mix: musicRow('MusicPlaylist'),
		podcast: spokenRow('PodcastSeries', 'PodcastEpisode'),
		audiobook: spokenRow('Audiobook', 'Chapter'),
		series: spokenRow('CreativeWorkSeries', 'CreativeWork'),
	},
	fallback: musicRow('MusicAlbum'),
};

export const playlistSections = {
	preamble: 'preamble',
	headline: 'title',
	blurb: 'description',
	media: 'media',
	body: 'body',
} as const;
export const playlistMediaSlots = { media: 'cover' } as const;

export const playlist = createContentModelSchema({
	schema: playlistSchema,
	sections: playlistSections,
	provides: ['prose'],
	mediaSlots: playlistMediaSlots,
	base: SplitLayoutModel,
	attributes: {
		type: {
			type: String,
			required: false,
			matches: playlistType.slice(),
			description: 'Collection format: album, podcast, audiobook, series, or mix.',
		},
		artist: {
			type: String,
			required: false,
			description: 'Default artist applied to tracks that omit their own.',
		},
		player: {
			type: Boolean,
			required: false,
			description: 'Enable/disable an embedded audio player for the playlist.',
		},
		content: {
			type: String,
			required: false,
			matches: contentType.slice(),
			description: 'How nested lists are interpreted: auto-detect, lyrics, or chapters.',
		},
		id: {
			type: String,
			required: false,
			description: 'Unique identifier used to link an audio rune to this playlist.',
		},
		meta: {
			type: String,
			required: false,
			matches: ['row', 'byline'],
			description:
				"Where each track's artist, date and running time sit: in its row (`row`) or beneath its name (`byline`). A track's own `meta` wins.",
		},
	},
	contentModel: {
		type: 'delimited',
		delimiter: 'hr',
		zones: [
			{
				name: 'media',
				type: 'sequence',
				fields: [{ name: 'media', match: 'any', optional: true, greedy: true }],
			},
			{
				name: 'content',
				primary: true,
				type: 'sequence',
				fields: [
					{
						name: 'headline',
						match: 'heading',
						optional: false,
						template: '# Playlist Name',
						description: 'Playlist title',
					},
					{
						name: 'blurb',
						match: 'paragraph',
						optional: true,
						template: 'A description of this playlist.',
						description: 'Playlist description',
					},
					{
						name: 'tracks',
						match: 'list|tag:track',
						greedy: true,
						optional: false,
						description: 'Track listing',
						template: '- **Track Name** (3:45)\n- **Another Track** (4:20)',
						itemModel: {
							fields: [
								{ name: 'name', match: 'strong', optional: false },
								{ name: 'src', match: 'link', optional: true, extract: 'href' },
								{ name: 'artist', match: 'em', optional: true },
								{
									name: 'duration',
									match: 'text',
									optional: true,
									pattern: /\((\d+:\d+(?::\d+)?)\)/,
								},
								{ name: 'date', match: 'text', optional: true, pattern: /—\s*(.+)$/ },
								{ name: 'description', match: 'paragraph', optional: true, greedy: true },
								{
									name: 'cuePoints',
									match: 'list',
									optional: true,
									itemModel: {
										fields: [
											{
												name: 'time',
												match: 'text',
												optional: true,
												pattern: /\(?(\d+:\d+(?::\d+)?)\)?/,
											},
											{ name: 'label', match: 'strong', optional: true },
											{ name: 'text', match: 'text', pattern: 'remainder', optional: false },
											{ name: 'description', match: 'paragraph', optional: true, greedy: true },
										],
									},
								},
							],
						},
					},
					{ name: 'body', match: 'any', optional: true, greedy: true },
				],
			},
		],
	},
	transform(resolved, attrs, config) {
		const contentZone = (resolved.content ?? {}) as ResolvedContent;
		const mediaZone = (resolved.media ?? {}) as ResolvedContent;

		const playlistTypeValue = (attrs.type as string) ?? 'album';
		const artistValue = (attrs.artist as string) ?? '';
		const hasPlayer = (attrs.player as boolean) ?? false;
		const contentMode = (attrs.content as string) ?? 'auto';
		const idValue = (attrs.id as string) ?? '';
		const metaValue = attrs.meta as string | undefined;

		const headerAstNodes = [contentZone.headline, contentZone.blurb].filter(Boolean) as Node[];
		const header = new RenderableNodeCursor(
			Markdoc.transform(headerAstNodes, config) as RenderableTreeNode[],
		);

		const mediaAstNodes = (Array.isArray(mediaZone.media) ? mediaZone.media : []) as Node[];
		const side = new RenderableNodeCursor(
			Markdoc.transform(mediaAstNodes, config) as RenderableTreeNode[],
		);

		const tracksData = (contentZone.tracksData as Record<string, unknown>[] | undefined) ?? [];

		const trackChildren = tracksData.map((track, index) => {
			const name = (track.name as string) ?? '';
			const src = (track.src as string) ?? '';
			const artist = (track.artist as string) ?? artistValue;
			const duration = (track.duration as string) ?? '';
			const date = (track.date as string)?.trim() ?? '';
			const cuePoints = (track.cuePoints as Record<string, unknown>[] | undefined) ?? [];

			const trackNameTag = new Tag('span', { 'data-name': 'track-name' }, [name]);
			const trackChildrenArr: any[] = [trackNameTag];

			const bag: Record<string, string> = {};
			if (artist) {
				bag.artist = artist;
				trackChildrenArr.push(new Tag('meta', { 'data-name': 'artist', content: artist }));
			}
			if (duration) {
				const iso = `PT${parseDuration(duration)}S`;
				bag.duration = iso;
				trackChildrenArr.push(new Tag('meta', { 'data-name': 'duration', content: iso }));
			}
			if (date) {
				bag.date = date;
				trackChildrenArr.push(new Tag('meta', { 'data-name': 'date', content: date }));
			}
			if (metaValue) bag.meta = metaValue;

			if (cuePoints.length > 0) {
				const cueListTag = buildCuePoints(cuePoints, contentMode);
				if (cueListTag) trackChildrenArr.push(cueListTag);
			}

			const trackAttrs: Record<string, any> = {
				'data-rune': 'track',
				'data-rune-fields': JSON.stringify(bag),
				elevation: 'flush',
			};
			if (src) trackAttrs['data-src'] = src;

			return new Tag('li', trackAttrs, trackChildrenArr);
		});

		const trackNodes = (contentZone.tracks ?? []) as Node[];
		const childKind = CHILD_KIND[playlistTypeValue] ?? 'song';
		const orderedTracks: any[] = [];
		let listCursor = 0;
		for (const node of Array.isArray(trackNodes) ? trackNodes : [trackNodes]) {
			if (!node || typeof node !== 'object') continue;
			if ((node as Node).type === 'list') {
				const count = ((node as Node).children ?? []).length;
				orderedTracks.push(...trackChildren.slice(listCursor, listCursor + count));
				listCursor += count;
				continue;
			}
			const transformed = new RenderableNodeCursor(
				Markdoc.transform([node], config) as RenderableTreeNode[],
			)
				.tag('li')
				.toArray();
			for (const li of transformed) {
				orderedTracks.push(adoptNestedTrack(li as any, childKind, artistValue, metaValue));
			}
		}
		if (listCursor < trackChildren.length) orderedTracks.push(...trackChildren.slice(listCursor));

		const tracksOl = new Tag('ol', {}, orderedTracks);

		let playerEl: any = null;
		if (hasPlayer) {
			const playerData = tracksData.map((track) => {
				const item: Record<string, any> = {
					name: (track.name as string) ?? '',
				};
				if (track.src) item.src = track.src;
				if (track.artist || artistValue) item.artist = (track.artist as string) ?? artistValue;
				if (track.duration) {
					item.duration = parseDuration((track.duration as string) ?? '');
				}
				return item;
			});

			playerEl = new Tag('div', { 'data-name': 'player' }, [
				new Tag('rf-audio', { waveform: 'false' }, [
					new Tag('script', { type: 'application/json' }, [JSON.stringify(playerData)]),
				]),
			]);
		}

		const { metas: layoutMetas } = buildLayoutMetas(attrs);
		const {
			mediaPosition: mediaPositionMeta,
			mediaRatio: mediaRatioMeta,
			valign: valignMeta,
			collapse: collapseMeta,
		} = layoutMetas;

		const typeMeta = new Tag('meta', { content: playlistTypeValue });
		const hasPlayerMeta = hasPlayer ? new Tag('meta', { content: 'true' }) : null;
		const artistMeta = artistValue ? new Tag('meta', { content: artistValue }) : null;
		const idMeta = idValue ? new Tag('meta', { content: idValue }) : null;

		const sectionProps = pageSectionProperties(header);

		let bodyDiv: RenderableNodeCursor<Markdoc.Tag> | undefined;
		if (contentZone.body) {
			const bodyNodes = renderNodes(contentZone.body, config);
			if (bodyNodes.count() > 0) {
				bodyDiv = bodyNodes.wrap('div') as RenderableNodeCursor<Markdoc.Tag>;
			}
		}

		const mediaImgTag = extractMediaImage(side);
		const mediaCursor = mediaImgTag ? new RenderableNodeCursor([mediaImgTag]) : side;
		const mediaDiv = mediaCursor.wrap('div');
		const hasMedia = mediaCursor.toArray().length > 0;

		const seoImage = mediaImgTag;

		const children: any[] = [];
		if (hasPlayerMeta) children.push(hasPlayerMeta);

		if (hasMedia) children.push(mediaDiv.next());
		children.push(...header.toArray());
		if (playerEl) children.push(playerEl);
		children.push(tracksOl);
		if (bodyDiv) children.push(bodyDiv.next());

		const trackItems = new RenderableNodeCursor(orderedTracks);

		return createComponentRenderable({
			rune: 'playlist',
			tag: 'section',
			properties: {
				type: typeMeta,
				'media-position': mediaPositionMeta,
				'media-ratio': mediaRatioMeta,
				valign: valignMeta,
				collapse: collapseMeta,
				artist: artistMeta,
				id: idMeta,
				track: trackItems,
			},
			refs: {
				...sectionProps,
				body: bodyDiv,
				tracks: tracksOl,
				media: mediaDiv,
				mediaImage: seoImage,
			},
			children,
		});
	},
});

function adoptNestedTrack(
	li: any,
	childKind: string,
	playlistArtist: string,
	playlistMeta?: string,
): any {
	if (!li || typeof li !== 'object') return li;

	if (!li[TYPE_IMPLICIT]) {
		const raw = li.attributes['data-rune-fields'];
		if (typeof raw === 'string') {
			try {
				const bag = JSON.parse(raw);
				bag.type = childKind;
				li.attributes['data-rune-fields'] = JSON.stringify(bag);
			} catch {
				// A malformed bag is not this function's to repair.
			}
		}
		for (const child of li.children ?? []) {
			if (child?.name === 'meta' && child.attributes?.['data-field'] === 'type') {
				child.attributes.content = childKind;
			}
		}
	}

	if (playlistArtist && !hasArtist(li)) {
		const artistMeta = new Markdoc.Tag('meta', {
			content: playlistArtist,
			'data-name': 'artist',
		});
		li.children = [...(li.children ?? []), artistMeta];
	}

	if (li.attributes.elevation === undefined) li.attributes.elevation = 'flush';

	const inherited: Record<string, string> = {};
	if (playlistMeta) inherited.meta = playlistMeta;
	if (playlistArtist) inherited.artist = playlistArtist;
	if (Object.keys(inherited).length > 0) {
		const raw = li.attributes['data-rune-fields'];
		try {
			const bag = typeof raw === 'string' ? JSON.parse(raw) : {};
			for (const [k, v] of Object.entries(inherited)) if (!bag[k]) bag[k] = v;
			li.attributes['data-rune-fields'] = JSON.stringify(bag);
		} catch {
			// A malformed bag is not this function's to repair.
		}
	}

	return li;
}

function hasArtist(li: any): boolean {
	const raw = li.attributes?.['data-rune-fields'];
	if (typeof raw === 'string') {
		try {
			if (JSON.parse(raw).artist) return true;
		} catch {
			// fall through to the node scan
		}
	}
	return (li.children ?? []).some(
		(c: any) => c?.attributes?.property === 'byArtist' || c?.attributes?.['data-name'] === 'artist',
	);
}

function buildCuePoints(cuePoints: Record<string, unknown>[], contentMode: string): any {
	if (cuePoints.length === 0) return null;

	const isLyrics =
		contentMode === 'lyrics' ||
		(contentMode === 'auto' &&
			cuePoints.every(
				(cp) => cp.time && typeof cp.text === 'string' && (cp.text as string).length < 100,
			));

	if (isLyrics) {
		const lyricItems = cuePoints.map((cp) => {
			const attrs: Record<string, any> = {};
			if (cp.time) attrs['data-time'] = String(parseDuration(cp.time as string));
			return new Tag('li', attrs, [
				new Tag('p', { 'data-name': 'lyric' }, [(cp.text as string) ?? '']),
			]);
		});
		return new Tag('ol', { 'data-name': 'lyrics' }, lyricItems);
	}

	const chapterItems = cuePoints.map((cp) => {
		const attrs: Record<string, any> = {};
		if (cp.time) attrs['data-time'] = String(parseDuration(cp.time as string));

		const chapterChildren: any[] = [];
		const label = (cp.label as string) || (cp.text as string) || '';
		if (label) {
			chapterChildren.push(new Tag('span', { 'data-name': 'chapter-name' }, [label]));
		}
		if (cp.time) {
			chapterChildren.push(new Tag('span', { 'data-name': 'chapter-time' }, [cp.time as string]));
		}

		return new Tag('li', attrs, chapterChildren);
	});

	return new Tag('ol', { 'data-name': 'chapters' }, chapterItems);
}

View plugins/media/src/tags/playlist.ts on GitHub

A list of tracks with its cover art: an album, a podcast's episodes, a mix. For a single song or episode, use track; to play one file with chapters or a waveform, audio.

Basic usage

An album with an artist and track listing.

{% playlist type="album" artist="Pink Floyd" media-position="start" %}
![The Dark Side of the Moon](https://assets.refrakt.md/playlist-dark-side-of-the-moon.png)

---

# The Dark Side of the Moon

A landmark progressive rock album exploring themes of time, death, and madness.

- **Speak to Me** (1:13)
- **Breathe** (2:43)
- **On the Run** (3:36)
- **Time** (7:05)
- **The Great Gig in the Sky** (4:44)
{% /playlist %}
<section data-rune="playlist" data-rune-fields="{&quot;type&quot;:&quot;album&quot;,&quot;media-position&quot;:&quot;start&quot;,&quot;artist&quot;:&quot;Pink Floyd&quot;}" typeof="MusicAlbum" data-schema-lists="[&quot;track&quot;]">
  <div data-name="media">
    <img src="https://assets.refrakt.md/playlist-dark-side-of-the-moon.png" alt="The Dark Side of the Moon" data-name="mediaImage" property="image">
  </div>
  <h1 id="the-dark-side-of-the-moon" data-name="headline" property="name">The Dark Side of the Moon</h1>
  <p data-name="blurb">A landmark progressive rock album exploring themes of time, death, and madness.</p>
  <ol data-name="tracks">
    <li data-rune="track" data-rune-fields="{&quot;artist&quot;:&quot;Pink Floyd&quot;,&quot;duration&quot;:&quot;PT73S&quot;}" elevation="flush" data-field="track" typeof="MusicRecording" property="track">
      <span data-name="track-name" property="name">Speak to Me</span>
      <meta data-name="artist" content="Pink Floyd" property="byArtist">
      <meta data-name="duration" content="PT73S" property="duration">
    </li>
    <li data-rune="track" data-rune-fields="{&quot;artist&quot;:&quot;Pink Floyd&quot;,&quot;duration&quot;:&quot;PT163S&quot;}" elevation="flush" data-field="track" typeof="MusicRecording" property="track">
      <span data-name="track-name" property="name">Breathe</span>
      <meta data-name="artist" content="Pink Floyd" property="byArtist">
      <meta data-name="duration" content="PT163S" property="duration">
    </li>
    <li data-rune="track" data-rune-fields="{&quot;artist&quot;:&quot;Pink Floyd&quot;,&quot;duration&quot;:&quot;PT216S&quot;}" elevation="flush" data-field="track" typeof="MusicRecording" property="track">
      <span data-name="track-name" property="name">On the Run</span>
      <meta data-name="artist" content="Pink Floyd" property="byArtist">
      <meta data-name="duration" content="PT216S" property="duration">
    </li>
    <li data-rune="track" data-rune-fields="{&quot;artist&quot;:&quot;Pink Floyd&quot;,&quot;duration&quot;:&quot;PT425S&quot;}" elevation="flush" data-field="track" typeof="MusicRecording" property="track">
      <span data-name="track-name" property="name">Time</span>
      <meta data-name="artist" content="Pink Floyd" property="byArtist">
      <meta data-name="duration" content="PT425S" property="duration">
    </li>
    <li data-rune="track" data-rune-fields="{&quot;artist&quot;:&quot;Pink Floyd&quot;,&quot;duration&quot;:&quot;PT284S&quot;}" elevation="flush" data-field="track" typeof="MusicRecording" property="track">
      <span data-name="track-name" property="name">The Great Gig in the Sky</span>
      <meta data-name="artist" content="Pink Floyd" property="byArtist">
      <meta data-name="duration" content="PT284S" property="duration">
    </li>
  </ol>
  <meta property="byArtist" content="Pink Floyd">
</section>
The Dark Side of the Moon
album

The Dark Side of the Moon

A landmark progressive rock album exploring themes of time, death, and madness.

  1. 1Speak to Me
    Pink Floyd1:13
  2. 2Breathe
    Pink Floyd2:43
  3. 3On the Run
    Pink Floyd3:36
  4. 4Time
    Pink Floyd7:05
  5. 5The Great Gig in the Sky
    Pink Floyd4:44
<section class="rf-playlist rf-playlist--album" typeof="MusicAlbum" data-schema-lists="[&quot;track&quot;]" data-type="album" data-media-position="start" data-artist="Pink Floyd" data-elevation="flat" data-rune="playlist" data-density="full">
  <div data-name="media" class="rf-playlist__media" data-section="media" data-media="cover" data-guest-fit="clip">
    <img src="https://assets.refrakt.md/playlist-dark-side-of-the-moon.png" alt="The Dark Side of the Moon" data-name="mediaImage" property="image" class="rf-playlist__mediaImage" />
  </div>
  <div data-name="content" class="rf-playlist__content">
    <div data-name="eyebrow" data-zone="eyebrow" data-zone-layout="bar" class="rf-playlist__eyebrow">
      <span data-meta-type="category" data-field="type">album</span>
    </div>
    <header data-name="preamble" class="rf-playlist__preamble" data-section="preamble">
      <h1 id="the-dark-side-of-the-moon" data-name="headline" property="name" class="rf-playlist__headline" data-section="title">The Dark Side of the Moon</h1>
      <p data-name="blurb" class="rf-playlist__blurb" data-section="description">A landmark progressive rock album exploring themes of time, death, and madness.</p>
    </header>
    <ol data-name="tracks" data-sequence="numbered" class="rf-playlist__tracks">
      <li data-field="track" typeof="MusicRecording" property="track" data-meta="row" data-artist="Pink Floyd" data-duration="PT73S" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">1</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">Speak to Me</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-field="artist">Pink Floyd</span>
          <span data-meta-type="quantity" data-align="end" data-field="duration">1:13</span>
        </div>
        <meta data-name="artist" content="Pink Floyd" property="byArtist" class="rf-track__artist" />
        <meta data-name="duration" content="PT73S" property="duration" class="rf-track__duration" />
      </li>
      <li data-field="track" typeof="MusicRecording" property="track" data-meta="row" data-artist="Pink Floyd" data-duration="PT163S" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">2</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">Breathe</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-field="artist">Pink Floyd</span>
          <span data-meta-type="quantity" data-align="end" data-field="duration">2:43</span>
        </div>
        <meta data-name="artist" content="Pink Floyd" property="byArtist" class="rf-track__artist" />
        <meta data-name="duration" content="PT163S" property="duration" class="rf-track__duration" />
      </li>
      <li data-field="track" typeof="MusicRecording" property="track" data-meta="row" data-artist="Pink Floyd" data-duration="PT216S" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">3</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">On the Run</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-field="artist">Pink Floyd</span>
          <span data-meta-type="quantity" data-align="end" data-field="duration">3:36</span>
        </div>
        <meta data-name="artist" content="Pink Floyd" property="byArtist" class="rf-track__artist" />
        <meta data-name="duration" content="PT216S" property="duration" class="rf-track__duration" />
      </li>
      <li data-field="track" typeof="MusicRecording" property="track" data-meta="row" data-artist="Pink Floyd" data-duration="PT425S" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">4</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">Time</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-field="artist">Pink Floyd</span>
          <span data-meta-type="quantity" data-align="end" data-field="duration">7:05</span>
        </div>
        <meta data-name="artist" content="Pink Floyd" property="byArtist" class="rf-track__artist" />
        <meta data-name="duration" content="PT425S" property="duration" class="rf-track__duration" />
      </li>
      <li data-field="track" typeof="MusicRecording" property="track" data-meta="row" data-artist="Pink Floyd" data-duration="PT284S" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">5</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">The Great Gig in the Sky</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-field="artist">Pink Floyd</span>
          <span data-meta-type="quantity" data-align="end" data-field="duration">4:44</span>
        </div>
        <meta data-name="artist" content="Pink Floyd" property="byArtist" class="rf-track__artist" />
        <meta data-name="duration" content="PT284S" property="duration" class="rf-track__duration" />
      </li>
    </ol>
  </div>
  <meta property="byArtist" content="Pink Floyd" />
</section>

How Markdown is read

You writeIt becomes
A headingThe playlist's title
The paragraph after itIts description
A list itemA track: bold text is its name, (3:45) its running time, italic text its artist, a link its audio file, and text after — its date
A list inside a track's itemThat track's chapter markers or lyrics
An image, then ---, before the restThe cover art (Place the cover)

Podcast

Use type="podcast" for episodic content with dates.

{% playlist type="podcast" %}
# Design Systems Weekly

A podcast about building and scaling design systems.

- **Component Libraries at Scale** (45:30) — March 2025
- **Token Architecture** (38:15) — February 2025
- **Accessibility First** (42:00) — January 2025
{% /playlist %}
<section data-rune="playlist" data-rune-fields="{&quot;type&quot;:&quot;podcast&quot;,&quot;media-position&quot;:&quot;top&quot;}" typeof="PodcastSeries" data-schema-lists="[&quot;hasPart&quot;]">
  <h1 id="design-systems-weekly" data-name="headline" property="name">Design Systems Weekly</h1>
  <p data-name="blurb">A podcast about building and scaling design systems.</p>
  <ol data-name="tracks">
    <li data-rune="track" data-rune-fields="{&quot;duration&quot;:&quot;PT2730S&quot;,&quot;date&quot;:&quot;March 2025&quot;}" elevation="flush" data-field="track" typeof="PodcastEpisode" property="hasPart">
      <span data-name="track-name" property="name">Component Libraries at Scale</span>
      <meta data-name="duration" content="PT2730S" property="duration">
      <meta data-name="date" content="March 2025" property="datePublished">
    </li>
    <li data-rune="track" data-rune-fields="{&quot;duration&quot;:&quot;PT2295S&quot;,&quot;date&quot;:&quot;February 2025&quot;}" elevation="flush" data-field="track" typeof="PodcastEpisode" property="hasPart">
      <span data-name="track-name" property="name">Token Architecture</span>
      <meta data-name="duration" content="PT2295S" property="duration">
      <meta data-name="date" content="February 2025" property="datePublished">
    </li>
    <li data-rune="track" data-rune-fields="{&quot;duration&quot;:&quot;PT2520S&quot;,&quot;date&quot;:&quot;January 2025&quot;}" elevation="flush" data-field="track" typeof="PodcastEpisode" property="hasPart">
      <span data-name="track-name" property="name">Accessibility First</span>
      <meta data-name="duration" content="PT2520S" property="duration">
      <meta data-name="date" content="January 2025" property="datePublished">
    </li>
  </ol>
</section>
podcast

Design Systems Weekly

A podcast about building and scaling design systems.

  1. 1Component Libraries at Scale
    45:30March 2025
  2. 2Token Architecture
    38:15February 2025
  3. 3Accessibility First
    42:00January 2025
<section class="rf-playlist rf-playlist--podcast" typeof="PodcastSeries" data-schema-lists="[&quot;hasPart&quot;]" data-type="podcast" data-media-position="top" data-elevation="flat" data-rune="playlist" data-density="full">
  <div data-name="content" class="rf-playlist__content">
    <div data-name="eyebrow" data-zone="eyebrow" data-zone-layout="bar" class="rf-playlist__eyebrow">
      <span data-meta-type="category" data-field="type">podcast</span>
    </div>
    <header data-name="preamble" class="rf-playlist__preamble" data-section="preamble">
      <h1 id="design-systems-weekly" data-name="headline" property="name" class="rf-playlist__headline" data-section="title">Design Systems Weekly</h1>
      <p data-name="blurb" class="rf-playlist__blurb" data-section="description">A podcast about building and scaling design systems.</p>
    </header>
    <ol data-name="tracks" data-sequence="numbered" class="rf-playlist__tracks">
      <li data-field="track" typeof="PodcastEpisode" property="hasPart" data-meta="row" data-duration="PT2730S" data-date="March 2025" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">1</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">Component Libraries at Scale</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-meta-type="quantity" data-align="end" data-field="duration">45:30</span>
          <span data-meta-type="temporal" data-field="date">March 2025</span>
        </div>
        <meta data-name="duration" content="PT2730S" property="duration" class="rf-track__duration" />
        <meta data-name="date" content="March 2025" property="datePublished" class="rf-track__date" />
      </li>
      <li data-field="track" typeof="PodcastEpisode" property="hasPart" data-meta="row" data-duration="PT2295S" data-date="February 2025" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">2</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">Token Architecture</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-meta-type="quantity" data-align="end" data-field="duration">38:15</span>
          <span data-meta-type="temporal" data-field="date">February 2025</span>
        </div>
        <meta data-name="duration" content="PT2295S" property="duration" class="rf-track__duration" />
        <meta data-name="date" content="February 2025" property="datePublished" class="rf-track__date" />
      </li>
      <li data-field="track" typeof="PodcastEpisode" property="hasPart" data-meta="row" data-duration="PT2520S" data-date="January 2025" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">3</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">Accessibility First</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-meta-type="quantity" data-align="end" data-field="duration">42:00</span>
          <span data-meta-type="temporal" data-field="date">January 2025</span>
        </div>
        <meta data-name="duration" content="PT2520S" property="duration" class="rf-track__duration" />
        <meta data-name="date" content="January 2025" property="datePublished" class="rf-track__date" />
      </li>
    </ol>
  </div>
</section>

Byline

meta="byline" sets each track's artist, date and running time beneath its name rather than along its row. It suits long titles, and narrow columns, where the row form hides the artist and date. A track's own meta wins over the playlist's.

{% playlist type="podcast" artist="Tech Weekly" meta="byline" %}
# Design Systems Weekly

- **Component Libraries at Scale** (45:30) — March 2025
- **Token Architecture** (38:15) — February 2025
{% /playlist %}
<section data-rune="playlist" data-rune-fields="{&quot;type&quot;:&quot;podcast&quot;,&quot;media-position&quot;:&quot;top&quot;,&quot;artist&quot;:&quot;Tech Weekly&quot;}" typeof="PodcastSeries" data-schema-lists="[&quot;hasPart&quot;]">
  <h1 id="design-systems-weekly" data-name="headline" property="name">Design Systems Weekly</h1>
  <ol data-name="tracks">
    <li data-rune="track" data-rune-fields="{&quot;artist&quot;:&quot;Tech Weekly&quot;,&quot;duration&quot;:&quot;PT2730S&quot;,&quot;date&quot;:&quot;March 2025&quot;,&quot;meta&quot;:&quot;byline&quot;}" elevation="flush" data-field="track" typeof="PodcastEpisode" property="hasPart">
      <span data-name="track-name" property="name">Component Libraries at Scale</span>
      <meta data-name="artist" content="Tech Weekly">
      <meta data-name="duration" content="PT2730S" property="duration">
      <meta data-name="date" content="March 2025" property="datePublished">
    </li>
    <li data-rune="track" data-rune-fields="{&quot;artist&quot;:&quot;Tech Weekly&quot;,&quot;duration&quot;:&quot;PT2295S&quot;,&quot;date&quot;:&quot;February 2025&quot;,&quot;meta&quot;:&quot;byline&quot;}" elevation="flush" data-field="track" typeof="PodcastEpisode" property="hasPart">
      <span data-name="track-name" property="name">Token Architecture</span>
      <meta data-name="artist" content="Tech Weekly">
      <meta data-name="duration" content="PT2295S" property="duration">
      <meta data-name="date" content="February 2025" property="datePublished">
    </li>
  </ol>
</section>
podcast

Design Systems Weekly

  1. 1
    Component Libraries at Scale
    Tech WeeklyMarch 202545:30
  2. 2
    Token Architecture
    Tech WeeklyFebruary 202538:15
<section class="rf-playlist rf-playlist--podcast" typeof="PodcastSeries" data-schema-lists="[&quot;hasPart&quot;]" data-type="podcast" data-media-position="top" data-artist="Tech Weekly" data-elevation="flat" data-rune="playlist" data-density="full">
  <div data-name="content" class="rf-playlist__content">
    <div data-name="eyebrow" data-zone="eyebrow" data-zone-layout="bar" class="rf-playlist__eyebrow">
      <span data-meta-type="category" data-field="type">podcast</span>
    </div>
    <header data-name="preamble" class="rf-playlist__preamble" data-section="preamble">
      <h1 id="design-systems-weekly" data-name="headline" property="name" class="rf-playlist__headline" data-section="title">Design Systems Weekly</h1>
    </header>
    <ol data-name="tracks" data-sequence="numbered" class="rf-playlist__tracks">
      <li data-field="track" typeof="PodcastEpisode" property="hasPart" data-meta="byline" data-artist="Tech Weekly" data-duration="PT2730S" data-date="March 2025" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">1</span>
        <div data-name="heading" class="rf-track__heading">
          <span data-name="track-name" property="name" class="rf-track__track-name">Component Libraries at Scale</span>
          <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
            <span data-field="artist">Tech Weekly</span>
            <span data-meta-type="temporal" data-field="date">March 2025</span>
            <span data-meta-type="quantity" data-field="duration">45:30</span>
          </div>
        </div>
        <meta data-name="artist" content="Tech Weekly" class="rf-track__artist" />
        <meta data-name="duration" content="PT2730S" property="duration" class="rf-track__duration" />
        <meta data-name="date" content="March 2025" property="datePublished" class="rf-track__date" />
      </li>
      <li data-field="track" typeof="PodcastEpisode" property="hasPart" data-meta="byline" data-artist="Tech Weekly" data-duration="PT2295S" data-date="February 2025" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">2</span>
        <div data-name="heading" class="rf-track__heading">
          <span data-name="track-name" property="name" class="rf-track__track-name">Token Architecture</span>
          <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
            <span data-field="artist">Tech Weekly</span>
            <span data-meta-type="temporal" data-field="date">February 2025</span>
            <span data-meta-type="quantity" data-field="duration">38:15</span>
          </div>
        </div>
        <meta data-name="artist" content="Tech Weekly" class="rf-track__artist" />
        <meta data-name="duration" content="PT2295S" property="duration" class="rf-track__duration" />
        <meta data-name="date" content="February 2025" property="datePublished" class="rf-track__date" />
      </li>
    </ol>
  </div>
</section>

Per-track artists

When tracks have different artists, use italic text for per-track attribution. Omit the artist attribute to avoid a default.

{% playlist type="mix" %}
# Summer Vibes 2025

- **Midnight City** (4:03) *M83*
- **Electric Feel** (3:49) *MGMT*
- **Do I Wanna Know?** (4:32) *Arctic Monkeys*
- **Intro** (4:18) *The xx*
{% /playlist %}
<section data-rune="playlist" data-rune-fields="{&quot;type&quot;:&quot;mix&quot;,&quot;media-position&quot;:&quot;top&quot;}" typeof="MusicPlaylist" data-schema-lists="[&quot;track&quot;]">
  <h1 id="summer-vibes-2025" data-name="headline" property="name">Summer Vibes 2025</h1>
  <ol data-name="tracks">
    <li data-rune="track" data-rune-fields="{&quot;artist&quot;:&quot;M83&quot;,&quot;duration&quot;:&quot;PT243S&quot;}" elevation="flush" data-field="track" typeof="MusicRecording" property="track">
      <span data-name="track-name" property="name">Midnight City</span>
      <meta data-name="artist" content="M83" property="byArtist">
      <meta data-name="duration" content="PT243S" property="duration">
    </li>
    <li data-rune="track" data-rune-fields="{&quot;artist&quot;:&quot;MGMT&quot;,&quot;duration&quot;:&quot;PT229S&quot;}" elevation="flush" data-field="track" typeof="MusicRecording" property="track">
      <span data-name="track-name" property="name">Electric Feel</span>
      <meta data-name="artist" content="MGMT" property="byArtist">
      <meta data-name="duration" content="PT229S" property="duration">
    </li>
    <li data-rune="track" data-rune-fields="{&quot;artist&quot;:&quot;Arctic Monkeys&quot;,&quot;duration&quot;:&quot;PT272S&quot;}" elevation="flush" data-field="track" typeof="MusicRecording" property="track">
      <span data-name="track-name" property="name">Do I Wanna Know?</span>
      <meta data-name="artist" content="Arctic Monkeys" property="byArtist">
      <meta data-name="duration" content="PT272S" property="duration">
    </li>
    <li data-rune="track" data-rune-fields="{&quot;artist&quot;:&quot;The xx&quot;,&quot;duration&quot;:&quot;PT258S&quot;}" elevation="flush" data-field="track" typeof="MusicRecording" property="track">
      <span data-name="track-name" property="name">Intro</span>
      <meta data-name="artist" content="The xx" property="byArtist">
      <meta data-name="duration" content="PT258S" property="duration">
    </li>
  </ol>
</section>
mix

Summer Vibes 2025

  1. 1Midnight City
    M834:03
  2. 2Electric Feel
    MGMT3:49
  3. 3Do I Wanna Know?
    Arctic Monkeys4:32
  4. 4Intro
    The xx4:18
<section class="rf-playlist rf-playlist--mix" typeof="MusicPlaylist" data-schema-lists="[&quot;track&quot;]" data-type="mix" data-media-position="top" data-elevation="flat" data-rune="playlist" data-density="full">
  <div data-name="content" class="rf-playlist__content">
    <div data-name="eyebrow" data-zone="eyebrow" data-zone-layout="bar" class="rf-playlist__eyebrow">
      <span data-meta-type="category" data-field="type">mix</span>
    </div>
    <header data-name="preamble" class="rf-playlist__preamble" data-section="preamble">
      <h1 id="summer-vibes-2025" data-name="headline" property="name" class="rf-playlist__headline" data-section="title">Summer Vibes 2025</h1>
    </header>
    <ol data-name="tracks" data-sequence="numbered" class="rf-playlist__tracks">
      <li data-field="track" typeof="MusicRecording" property="track" data-meta="row" data-artist="M83" data-duration="PT243S" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">1</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">Midnight City</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-field="artist">M83</span>
          <span data-meta-type="quantity" data-align="end" data-field="duration">4:03</span>
        </div>
        <meta data-name="artist" content="M83" property="byArtist" class="rf-track__artist" />
        <meta data-name="duration" content="PT243S" property="duration" class="rf-track__duration" />
      </li>
      <li data-field="track" typeof="MusicRecording" property="track" data-meta="row" data-artist="MGMT" data-duration="PT229S" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">2</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">Electric Feel</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-field="artist">MGMT</span>
          <span data-meta-type="quantity" data-align="end" data-field="duration">3:49</span>
        </div>
        <meta data-name="artist" content="MGMT" property="byArtist" class="rf-track__artist" />
        <meta data-name="duration" content="PT229S" property="duration" class="rf-track__duration" />
      </li>
      <li data-field="track" typeof="MusicRecording" property="track" data-meta="row" data-artist="Arctic Monkeys" data-duration="PT272S" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">3</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">Do I Wanna Know?</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-field="artist">Arctic Monkeys</span>
          <span data-meta-type="quantity" data-align="end" data-field="duration">4:32</span>
        </div>
        <meta data-name="artist" content="Arctic Monkeys" property="byArtist" class="rf-track__artist" />
        <meta data-name="duration" content="PT272S" property="duration" class="rf-track__duration" />
      </li>
      <li data-field="track" typeof="MusicRecording" property="track" data-meta="row" data-artist="The xx" data-duration="PT258S" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">4</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">Intro</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-field="artist">The xx</span>
          <span data-meta-type="quantity" data-align="end" data-field="duration">4:18</span>
        </div>
        <meta data-name="artist" content="The xx" property="byArtist" class="rf-track__artist" />
        <meta data-name="duration" content="PT258S" property="duration" class="rf-track__duration" />
      </li>
    </ol>
  </div>
</section>

With chapter markers

Tracks can include nested lists for chapter markers or lyrics. Use content="chapters" or content="lyrics" to force the display mode, or leave it as auto for automatic detection.

{% playlist type="podcast" content="chapters" %}
# Tech Talk: Web Components

- **Episode 42: Shadow DOM Deep Dive** (1:02:15)
  1. **Introduction** (0:00) Overview of today's topic
  2. **What is Shadow DOM?** (3:45) Core concepts explained
  3. **Styling strategies** (18:30) CSS custom properties and parts
  4. **Q&A** (45:00) Listener questions
{% /playlist %}
<section data-rune="playlist" data-rune-fields="{&quot;type&quot;:&quot;podcast&quot;,&quot;media-position&quot;:&quot;top&quot;}" typeof="PodcastSeries" data-schema-lists="[&quot;hasPart&quot;]">
  <h1 id="tech-talk-web-components" data-name="headline" property="name">Tech Talk: Web Components</h1>
  <ol data-name="tracks">
    <li data-rune="track" data-rune-fields="{&quot;duration&quot;:&quot;PT3735S&quot;}" elevation="flush" data-field="track" typeof="PodcastEpisode" property="hasPart">
      <span data-name="track-name" property="name">Episode 42: Shadow DOM Deep Dive</span>
      <meta data-name="duration" content="PT3735S" property="duration">
      <ol data-name="chapters">
        <li data-time="0">
          <span data-name="chapter-name">Introduction</span>
          <span data-name="chapter-time">0:00</span>
        </li>
        <li data-time="225">
          <span data-name="chapter-name">What is Shadow DOM?</span>
          <span data-name="chapter-time">3:45</span>
        </li>
        <li data-time="1110">
          <span data-name="chapter-name">Styling strategies</span>
          <span data-name="chapter-time">18:30</span>
        </li>
        <li data-time="2700">
          <span data-name="chapter-name">Q&amp;A</span>
          <span data-name="chapter-time">45:00</span>
        </li>
      </ol>
    </li>
  </ol>
</section>
podcast

Tech Talk: Web Components

  1. 1Episode 42: Shadow DOM Deep Dive
    1:02:15
    1. Introduction0:00
    2. What is Shadow DOM?3:45
    3. Styling strategies18:30
    4. Q&A45:00
<section class="rf-playlist rf-playlist--podcast" typeof="PodcastSeries" data-schema-lists="[&quot;hasPart&quot;]" data-type="podcast" data-media-position="top" data-elevation="flat" data-rune="playlist" data-density="full">
  <div data-name="content" class="rf-playlist__content">
    <div data-name="eyebrow" data-zone="eyebrow" data-zone-layout="bar" class="rf-playlist__eyebrow">
      <span data-meta-type="category" data-field="type">podcast</span>
    </div>
    <header data-name="preamble" class="rf-playlist__preamble" data-section="preamble">
      <h1 id="tech-talk-web-components" data-name="headline" property="name" class="rf-playlist__headline" data-section="title">Tech Talk: Web Components</h1>
    </header>
    <ol data-name="tracks" data-sequence="numbered" class="rf-playlist__tracks">
      <li data-field="track" typeof="PodcastEpisode" property="hasPart" data-meta="row" data-duration="PT3735S" data-elevation="flush" class="rf-track" data-rune="track" data-density="full">
        <span data-name="ordinal" data-meta-type="quantity" class="rf-track__ordinal">1</span>
        <span data-name="track-name" property="name" class="rf-track__track-name">Episode 42: Shadow DOM Deep Dive</span>
        <div data-name="details" data-zone="details" data-zone-layout="bar" class="rf-track__details">
          <span data-meta-type="quantity" data-align="end" data-field="duration">1:02:15</span>
        </div>
        <meta data-name="duration" content="PT3735S" property="duration" class="rf-track__duration" />
        <ol data-name="chapters" class="rf-track__chapters">
          <li data-time="0">
            <span data-name="chapter-name">Introduction</span>
            <span data-name="chapter-time">0:00</span>
          </li>
          <li data-time="225">
            <span data-name="chapter-name">What is Shadow DOM?</span>
            <span data-name="chapter-time">3:45</span>
          </li>
          <li data-time="1110">
            <span data-name="chapter-name">Styling strategies</span>
            <span data-name="chapter-time">18:30</span>
          </li>
          <li data-time="2700">
            <span data-name="chapter-name">Q&amp;A</span>
            <span data-name="chapter-time">45:00</span>
          </li>
        </ol>
      </li>
    </ol>
  </div>
</section>

Place the cover

The body splits on --- into media (cover art) → content (tracks) zones (media-first in source). media-position controls visual placement independently of source order.

media-ratio, valign and collapse tune a side-by-side split, as on card.

Attributes

AttributeTypeRequiredDescription
type"album" | "podcast" | "audiobook" | "series" | "mix"—Collection format: album, podcast, audiobook, series, or mix.
artiststring—Default artist applied to tracks that omit their own.
playerboolean—Enable/disable an embedded audio player for the playlist.
content"auto" | "lyrics" | "chapters"—How nested lists are interpreted: auto-detect, lyrics, or chapters.
idstring—Unique identifier used to link an audio rune to this playlist.
meta"row" | "byline"—Where each track's artist, date and running time sit: in its row (`row`) or beneath its name (`byline`). A track's own `meta` wins.

Inherited from the split layout preset

AttributeTypeRequiredDescription
media-position"top" | "bottom" | "start" | "end" | "cover"—Where the media zone sits relative to the content: above (top), below (bottom), or beside (start/end)
media-ratio"1/3" | "2/5" | "1/2" | "3/5" | "2/3"—Media zone’s share of the row width when media is beside content (start/end)
valign"top" | "center" | "bottom" | "stretch"—Cross-axis alignment when media is beside content (start/end); applies to the shorter zone
collapse"sm" | "md" | "lg" | "never"—Breakpoint at which side-by-side layouts collapse to a single stacked column

Universal attributes

bg

The background layer: image, video, gradient, flat overlay wash and legibility scrim, in a single injected layer behind the rune's content.

AttributeTypeRequiredDescription
bgstring—Background preset applied to this block
bg-fromstring—Gradient start colour — a semantic token name (→ var(--rf-color-*))
bg-gradient"to-t" | "to-b" | "to-l" | "to-r" | "to-tr" | "to-br" | "to-bl" | "to-tl"—Gradient direction (bounded named set)
bg-gradient-type"linear" | "radial" | "conic"—Gradient type
bg-tostring—Gradient end colour — a semantic token name
bg-viastring—Optional middle gradient stop — a semantic token name
scrim"top" | "bottom" | "left" | "right" | "none"—Scrim direction (heaviest edge); presence turns the scrim on, "none" opts out of the default cover scrim
scrim-blur"none" | "sm" | "md" | "lg"—Frost scrim blur amount
scrim-strength"sm" | "md" | "lg"—Gradient scrim strength
scrim-tone"dark" | "light"—Whether the scrim darkens (for light text) or lightens (for dark text)
scrim-type"gradient" | "frost"—Scrim treatment: gradient (default) or frost (backdrop blur)
dropcap

Per-instance drop-cap opt-in.

AttributeTypeRequiredDescription
dropcapboolean—Style the opening letter of a prose body as a drop cap. Honoured only when the body reads as prose; ignored otherwise.
elevation

How far the rune sits off the page, from sunken to overlay. The theme decides what each step looks like.

AttributeTypeRequiredDescription
elevation"sunken" | "flush" | "flat" | "raised" | "floating" | "overlay" | "none" | "sm" | "md" | "lg"—Surface depth, from sunken to overlay. Deprecated: none, sm, md and lg (read as flat, raised, raised and floating)
frame

Surface chrome: a named preset from the theme registry with inline `frame-*` overrides layered on top.

AttributeTypeRequiredDescription
framestring—Named frame preset presenting this block's media surface
frame-anchorstring—Crop focal point when the guest is cut (object-position)
frame-aspectstring—Aspect ratio of the framed media, e.g. "16/9"
frame-displace"top" | "bottom" | "end" | "bottom-end" | "top-end" | "both"—Edge/corner the framed guest moves toward
frame-displace-mode"peek" | "bleed"—How displacement renders: `peek` (default) translates the guest visually inside its frame target; `bleed` uses negative margin on the media zone so following layout pulls up — extends past a section like a hero without leaving a gap above
frame-offset"none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl"—Displacement distance (non-linear named scale: sm…xl ride the block-spacing tokens, 2xl/3xl/4xl step up to section-spacing for bleed-mode displacements that clear a section edge)
frame-overflow"clip" | "bleed"—How the frame handles a guest whose content is wider than it: `clip` (default) keeps it inside the rounded frame; `bleed` runs an overflowing guest out to the layout edge on a narrow viewport so it reads as cropped by the screen (a bleed host only — hero/feature)
frame-oversizestring—How far the guest exceeds its slot (scale factor)
frame-placestring—Guest-box alignment in the slot (e.g. "left top")
frame-shadow"none" | "sm" | "md" | "lg"—Silhouette drop-shadow strength for the framed media
inset

Internal padding override.

AttributeTypeRequiredDescription
inset"flush" | "tight" | "default" | "loose" | "breathe"—Inner padding of this block
motion

Scroll-reveal entrance. You choose its character; the theme decides how it moves.

AttributeTypeRequiredDescription
reveal"none" | "fade" | "slide" | "scale" | "blur"—Scroll-reveal entrance character (none|fade|slide|scale|blur); the theme owns the choreography
staggerboolean—Cascade this block's items in as it reveals (no-op on single-child runes)
prominence

Header emphasis. Scales a rune's header, or its featured quotation; the theme decides the type size for each step.

AttributeTypeRequiredDescription
prominence"quiet" | "normal" | "prominent" | "display" | "marquee"—Emphasis of a page-section header or a featured quotation (only on runes that have one)
reading

Editorial register for body text. You pick the register; the theme decides how it looks.

AttributeTypeRequiredDescription
reading"fine" | "ui" | "prose"—Reading register for this block’s body: fine | ui | prose. The theme sets how each one looks.
spacing

Block-level rhythm override.

AttributeTypeRequiredDescription
spacing"flush" | "tight" | "default" | "loose" | "breathe"—Vertical spacing above and below this block
substrate

Generated pattern fills behind the content, drawn by the theme.

AttributeTypeRequiredDescription
substrate"dots" | "grid" | "lines" | "cross" | "checker" | "none"—Generated surface pattern
substrate-fill"inherit" | "inset"—Surface fill the pattern sits on (full colour stays with tint)
substrate-opacity"sm" | "md" | "lg"—Pattern ink strength
substrate-size"sm" | "md" | "lg"—Pattern cell size
substrate-target"self" | "media"—Which surface the pattern fills (overrides the rune/theme default)
tint

Per-rune colour override: a named tint from the theme registry, with inline per-token overrides layered on top.

AttributeTypeRequiredDescription
tintstring—Color tint preset applied to this block
tint-mode"auto" | "dark" | "light"—Whether the tint adapts to auto, dark, or light mode
width

The track a block rune occupies.

AttributeTypeRequiredDescription
width"compact" | "narrow" | "content" | "wide" | "full"—Maximum width constraint for this block