---
title: "Playlist Item"
description: "Represents one selectable track or episode within a playlist - number, cover, title, artist and length; the selected one shows &quot;now playing&quot; bars."
slug: "playlist-item"
---

import { DocPage, PageHeader, SkillPanel, SourceFiles, DocLink, SkillField, SkillText, SkillRow, ApiPill } from "../../lib/components/index";

<DocPage meta={meta}>

<PageHeader slug="playlist-item" title="Playlist Item" component="playlist-item">
  Represents one selectable track or episode within a playlist - number, cover, title, artist and length; the selected one shows "now playing" bars. Part of the <DocLink href="website-media.html">Media</DocLink> blocks.
</PageHeader>

<SkillPanel component="playlist-item">
  <SkillField label="Native basis">
<SkillText>An <code>&lt;li&gt;</code> in an <code>&lt;ol class="mk-playlist"&gt;</code> holding a <code>&lt;label&gt;</code> around a radio input: the index (replaced by animated bars when selected), a cover, title and artist, and the duration.</SkillText>
  </SkillField>

  <SkillField label="Web Platform APIs">
<SkillRow>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/CSS/:has" title="parent styles react to a checked input or a state inside"><code>:has()</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol" title="an ordered sequence"><code>&lt;ol&gt;</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion" title="motion stands still on request"><code>prefers-reduced-motion</code></ApiPill>
  </SkillRow>
  </SkillField>

  <SkillField label="Classes">
<SkillRow>
    <code>.mk-playlist</code>
    <code>.mk-playlist-item</code>
    <code>.mk-playlist-item-index</code>
    <code>.mk-playlist-item-bars</code>
    <code>.mk-playlist-item-text</code>
    <code>.mk-playlist-item-cover</code>
    <code>.mk-playlist-item-desc</code>
    <code>.mk-playlist-item-duration</code>
  </SkillRow>
  </SkillField>

  <SkillField label="Data attributes">
<SkillText><code>data-variant="episode"</code>.</SkillText>
  </SkillField>
</SkillPanel>

```html example label="Tracks" hint="Each track is a radio input in its label - click a track or use the arrow keys; :has(:checked) highlights it and swaps the number for animated &quot;now playing&quot; bars (still under reduced motion)." previewStyle="align-items:stretch;"
<ol class="mk-playlist" role="radiogroup" aria-label="Album: Quiet Hours" style="max-width: 34rem">
  <li class="mk-playlist-item">
    <label>
      <input type="radio" name="track" value="1" />
      <span class="mk-playlist-item-index" aria-hidden="true"
        ><span>1</span><i class="mk-playlist-item-bars"><b></b><b></b><b></b></i
      ></span>
      <img class="mk-playlist-item-cover" src="images/photos/s-pl-1-160x160.webp" alt="" />
      <span class="mk-playlist-item-text"><strong>First Light</strong><small>Nordlicht</small></span>
      <span class="mk-playlist-item-duration">3:42</span>
    </label>
  </li>
  <li class="mk-playlist-item">
    <label>
      <input type="radio" name="track" value="2" checked />
      <span class="mk-playlist-item-index" aria-hidden="true"
        ><span>2</span><i class="mk-playlist-item-bars"><b></b><b></b><b></b></i
      ></span>
      <img class="mk-playlist-item-cover" src="images/photos/s-pl-2-160x160.webp" alt="" />
      <span class="mk-playlist-item-text"><strong>Harbour Lines</strong><small>Nordlicht</small></span>
      <span class="mk-playlist-item-duration">4:05</span>
    </label>
  </li>
  <li class="mk-playlist-item">
    <label>
      <input type="radio" name="track" value="3" />
      <span class="mk-playlist-item-index" aria-hidden="true"
        ><span>3</span><i class="mk-playlist-item-bars"><b></b><b></b><b></b></i
      ></span>
      <img class="mk-playlist-item-cover" src="images/photos/s-pl-3-160x160.webp" alt="" />
      <span class="mk-playlist-item-text"><strong>Slow Tram</strong><small>Nordlicht feat. Mar</small></span>
      <span class="mk-playlist-item-duration">2:58</span>
    </label>
  </li>
  <li class="mk-playlist-item">
    <label>
      <input type="radio" name="track" value="4" />
      <span class="mk-playlist-item-index" aria-hidden="true"
        ><span>4</span><i class="mk-playlist-item-bars"><b></b><b></b><b></b></i
      ></span>
      <img class="mk-playlist-item-cover" src="images/photos/s-pl-4-160x160.webp" alt="" />
      <span class="mk-playlist-item-text"><strong>Tiles in the Rain</strong><small>Nordlicht</small></span>
      <span class="mk-playlist-item-duration">5:11</span>
    </label>
  </li>
</ol>
```

```html example label="Episodes" hint="data-variant='episode': a larger cover, the date and a two-line description." previewStyle="align-items:stretch;"
<ol class="mk-playlist" role="radiogroup" aria-label="The Calm Letter - episodes" style="max-width: 40rem">
  <li class="mk-playlist-item" data-variant="episode">
    <label>
      <input type="radio" name="episode" value="42" checked />
      <span class="mk-playlist-item-index" aria-hidden="true"
        ><span>42</span><i class="mk-playlist-item-bars"><b></b><b></b><b></b></i
      ></span>
      <img class="mk-playlist-item-cover" src="images/photos/s-ep-42-160x160.webp" alt="" />
      <span class="mk-playlist-item-text"
        ><strong>Why we never ship on Fridays</strong
        ><small>The Calm Letter · <time datetime="2026-09-30">2026-09-30</time></small
        ><span class="mk-playlist-item-desc"
          >Alex and Sophie on release rhythms, weekends and why boring deploys are the best deploys.</span
        ></span
      >
      <span class="mk-playlist-item-duration">32 min</span>
    </label>
  </li>
  <li class="mk-playlist-item" data-variant="episode">
    <label>
      <input type="radio" name="episode" value="41" />
      <span class="mk-playlist-item-index" aria-hidden="true"
        ><span>41</span><i class="mk-playlist-item-bars"><b></b><b></b><b></b></i
      ></span>
      <img class="mk-playlist-item-cover" src="images/photos/s-ep-41-160x160.webp" alt="" />
      <span class="mk-playlist-item-text"
        ><strong>Writing decisions down</strong
        ><small>The Calm Letter · <time datetime="2026-09-23">2026-09-23</time></small
        ><span class="mk-playlist-item-desc"
          >Hannah explains how her team replaced status meetings with a written decision log.</span
        ></span
      >
      <span class="mk-playlist-item-duration">28 min</span>
    </label>
  </li>
</ol>
```

<SourceFiles component="playlist-item" section="css" />

</DocPage>
