---
title: "Collection Item"
description: "Links to one product collection with imagery and context - a picture with the name and count, text over the picture, or a wide banner."
slug: "collection-item"
---

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

<DocPage meta={meta}>

<PageHeader slug="collection-item" title="Collection Item" component="collection-item">
  Links to one product collection with imagery and context - a picture with the name and count, text over the picture, or a wide banner. Part of the <DocLink href="website-shop.html">Shop</DocLink> blocks.
</PageHeader>

<SkillPanel component="collection-item">
  <SkillField label="Native basis">
<SkillText>An <code>&lt;article&gt;</code>: a picture, the collection name as a link covering the card, the number of products and a decorative "Shop now" cue.</SkillText>
  </SkillField>

  <SkillField label="Web Platform APIs">
<SkillRow>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article" title="a self-contained item"><code>&lt;article&gt;</code></ApiPill>
    <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/CSS/object-fit" title="pictures crop instead of stretching"><code>object-fit</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio" title="stable media boxes, no layout shift"><code>aspect-ratio</code></ApiPill>
  </SkillRow>
  </SkillField>

  <SkillField label="Classes">
<SkillRow>
    <code>.mk-collection-item</code>
    <code>.mk-collection-item-title</code>
    <code>.mk-collection-item-media</code>
    <code>.mk-collection-item-body</code>
    <code>.mk-collection-item-count</code>
    <code>.mk-collection-item-more</code>
    <code>.mk-collection-item-badge</code>
    <code>.mk-collection-item-stack</code>
  </SkillRow>
  </SkillField>

  <SkillField label="Data attributes">
<SkillText><code>data-variant</code>: <code>overlay</code>, <code>stack</code>, <code>banner</code>; <code>data-tone="sale"</code> on the badge; <code>--mk-collection-tint</code> for the stack's panel.</SkillText>
  </SkillField>
</SkillPanel>

```html example label="Banner" hint="data-variant='banner': a wide 21:9 picture with the copy on the start side and a pill cue." previewStyle="align-items:stretch;"
<article class="mk-collection-item" data-variant="banner">
  <img
    class="mk-collection-item-media"
    src="images/photos/42-1600x690.webp"
    alt="A long wooden café table with two espresso cups in the morning light"
  />
  <div class="mk-collection-item-body">
    <h3 class="mk-collection-item-title"><a href="#">Slow mornings</a></h3>
    <p class="mk-collection-item-count">Cups, grinders and beans for the first hour - 56 pieces</p>
    <span class="mk-collection-item-more" aria-hidden="true">Discover <i data-lucide="arrow-right"></i></span>
  </div>
</article>
```

```html example label="Grid" hint="Default: a 4:5 picture, the collection name - a link covering the card - the count and a &quot;Shop now&quot; cue. On hover or keyboard focus the card lifts, its picture casts a shadow and the cue underlines. .mk-collection-item-badge labels a card over its picture (data-tone=&quot;sale&quot; for a reduction)." previewStyle="align-items:stretch;"
<div
  style="display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1.75rem 1.25rem; width: 100%"
>
  <article class="mk-collection-item">
    <img
      class="mk-collection-item-media"
      src="images/photos/766-800x1000.webp"
      alt="Dark roasted coffee beans, close up"
    />
    <span class="mk-collection-item-badge">Bestseller</span>
    <div class="mk-collection-item-body">
      <h3 class="mk-collection-item-title"><a href="#">Coffee beans</a></h3>
      <p class="mk-collection-item-count">24 roasts</p>
      <span class="mk-collection-item-more" aria-hidden="true">Shop now <i data-lucide="arrow-right"></i></span>
    </div>
  </article>
  <article class="mk-collection-item">
    <img
      class="mk-collection-item-media"
      src="images/photos/1060-800x1000.webp"
      alt="Water poured from a gooseneck kettle over a pour-over coffee maker"
    />
    <span class="mk-collection-item-badge">New</span>
    <div class="mk-collection-item-body">
      <h3 class="mk-collection-item-title"><a href="#">Brewing gear</a></h3>
      <p class="mk-collection-item-count">18 products</p>
      <span class="mk-collection-item-more" aria-hidden="true">Shop now <i data-lucide="arrow-right"></i></span>
    </div>
  </article>
  <article class="mk-collection-item">
    <img
      class="mk-collection-item-media"
      src="images/photos/225-800x1000.webp"
      alt="A glass teapot of green tea and a small cup on a table"
    />
    <div class="mk-collection-item-body">
      <h3 class="mk-collection-item-title"><a href="#">Tea</a></h3>
      <p class="mk-collection-item-count">31 blends</p>
      <span class="mk-collection-item-more" aria-hidden="true">Shop now <i data-lucide="arrow-right"></i></span>
    </div>
  </article>
  <article class="mk-collection-item">
    <img
      class="mk-collection-item-media"
      src="images/photos/225-800x1000.webp"
      alt="A glass teapot of golden tea beside yellow flowers"
    />
    <span class="mk-collection-item-badge" data-tone="sale">-20 %</span>
    <div class="mk-collection-item-body">
      <h3 class="mk-collection-item-title"><a href="#">Pantry</a></h3>
      <p class="mk-collection-item-count">42 products</p>
      <span class="mk-collection-item-more" aria-hidden="true">Shop now <i data-lucide="arrow-right"></i></span>
    </div>
  </article>
</div>
```

```html example label="Overlay" hint="data-variant='overlay': the name over the picture with a scrim; the badge turns to glass, the picture zooms a little and the cue rises on hover or focus (always shown on touch screens)." previewStyle="align-items:stretch;"
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1rem; width: 100%">
  <article class="mk-collection-item" data-variant="overlay">
    <img
      class="mk-collection-item-media"
      src="images/photos/431-800x1000.webp"
      alt="A cappuccino with latte art beside a brass bell on a café counter"
    />
    <span class="mk-collection-item-badge">Staff picks</span>
    <div class="mk-collection-item-body">
      <h3 class="mk-collection-item-title"><a href="#">Café favourites</a></h3>
      <p class="mk-collection-item-count">Picked by our baristas</p>
      <span class="mk-collection-item-more" aria-hidden="true">Shop now <i data-lucide="arrow-right"></i></span>
    </div>
  </article>
  <article class="mk-collection-item" data-variant="overlay">
    <img
      class="mk-collection-item-media"
      src="images/photos/429-800x1000.webp"
      alt="Fresh raspberries in a white cup"
    />
    <span class="mk-collection-item-badge">Seasonal</span>
    <div class="mk-collection-item-body">
      <h3 class="mk-collection-item-title"><a href="#">Fresh this week</a></h3>
      <p class="mk-collection-item-count">12 products</p>
      <span class="mk-collection-item-more" aria-hidden="true">Shop now <i data-lucide="arrow-right"></i></span>
    </div>
  </article>
  <article class="mk-collection-item" data-variant="overlay">
    <img
      class="mk-collection-item-media"
      src="images/photos/1036-800x1000.webp"
      alt="Two yellow tents in the snow below a mountain range"
    />
    <span class="mk-collection-item-badge" data-tone="sale">Last chance</span>
    <div class="mk-collection-item-body">
      <h3 class="mk-collection-item-title"><a href="#">Coffee outdoors</a></h3>
      <p class="mk-collection-item-count">Up to -50 %</p>
      <span class="mk-collection-item-more" aria-hidden="true">Shop now <i data-lucide="arrow-right"></i></span>
    </div>
  </article>
</div>
```

```html example label="Stack" hint="data-variant='stack': three pictures of the collection as prints on a tinted panel (.mk-collection-item-stack, the tint from --mk-collection-tint); they fan out on hover or focus." previewStyle="align-items:stretch;"
<div
  style="display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.5rem 1.25rem; width: 100%"
>
  <article class="mk-collection-item" data-variant="stack" style="--mk-collection-tint: oklch(0.93 0.04 60)">
    <div class="mk-collection-item-stack">
      <img
        class="mk-collection-item-media"
        src="images/photos/1060-600x750.webp"
        alt="A pour-over coffee being brewed"
      />
      <img class="mk-collection-item-media" src="images/photos/225-600x750.webp" alt="A glass teapot of green tea" />
      <img class="mk-collection-item-media" src="images/photos/431-600x750.webp" alt="A cappuccino with latte art" />
    </div>
    <span class="mk-collection-item-badge">New</span>
    <div class="mk-collection-item-body">
      <h3 class="mk-collection-item-title"><a href="#">Brew at home</a></h3>
      <p class="mk-collection-item-count">3 guides, 27 products</p>
      <span class="mk-collection-item-more" aria-hidden="true"
        >Shop the collection <i data-lucide="arrow-right"></i
      ></span>
    </div>
  </article>
  <article class="mk-collection-item" data-variant="stack" style="--mk-collection-tint: oklch(0.93 0.05 140)">
    <div class="mk-collection-item-stack">
      <img
        class="mk-collection-item-media"
        src="images/photos/292-600x750.webp"
        alt="Red onions, herbs and peppercorns on a chopping board"
      />
      <img
        class="mk-collection-item-media"
        src="images/photos/488-600x750.webp"
        alt="A clay bowl of salad from above"
      />
      <img
        class="mk-collection-item-media"
        src="images/photos/835-600x750.webp"
        alt="Cookies, lemons and daffodils on a dark table"
      />
    </div>
    <div class="mk-collection-item-body">
      <h3 class="mk-collection-item-title"><a href="#">The weekend kitchen</a></h3>
      <p class="mk-collection-item-count">36 products</p>
      <span class="mk-collection-item-more" aria-hidden="true"
        >Shop the collection <i data-lucide="arrow-right"></i
      ></span>
    </div>
  </article>
  <article class="mk-collection-item" data-variant="stack" style="--mk-collection-tint: oklch(0.92 0.03 240)">
    <div class="mk-collection-item-stack">
      <img
        class="mk-collection-item-media"
        src="images/photos/1036-600x750.webp"
        alt="Tents in the snow below mountains"
      />
      <img class="mk-collection-item-media" src="images/photos/1018-600x750.webp" alt="A road through a green valley" />
      <img class="mk-collection-item-media" src="images/photos/250-600x750.webp" alt="An old film camera on a piano" />
    </div>
    <div class="mk-collection-item-body">
      <h3 class="mk-collection-item-title"><a href="#">Out of office</a></h3>
      <p class="mk-collection-item-count">19 products</p>
      <span class="mk-collection-item-more" aria-hidden="true"
        >Shop the collection <i data-lucide="arrow-right"></i
      ></span>
    </div>
  </article>
</div>
```

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

</DocPage>
