Skip to content

Collection

Preview Available in release assets

Compose addressable product discovery around a normal GET filter form and durable product links.

Collection in context

Show code
<section class="thin-collection" aria-labelledby="collection-title">
  <header class="thin-collection-header">
    <p>Spring carry</p>
    <h1 id="collection-title">Made to go everywhere</h1>
    <p>Durable bags for daily routes and longer departures.</p>
  </header>
  <div class="thin-collection-layout">
    <aside>
      <form class="thin-product-filters" action="/collections/bags" method="get">
        <fieldset>
          <legend>Availability</legend>
          <div class="thin-choice-row">
            <input class="thin-choice" id="availability-in-stock" type="checkbox" name="availability" value="in-stock">
            <label for="availability-in-stock">In stock</label>
          </div>
        </fieldset>
        <button class="thin-button">Apply filters</button>
        <a href="/collections/bags">Clear filters</a>
      </form>
    </aside>
    <div class="thin-stack">
      <p class="thin-results-summary">
        <strong>24 products</strong>
        <span aria-live="polite">Sorted by featured</span>
      </p>
      <div class="thin-product-grid">
        <article class="thin-product-card">
          <a href="/products/tote">
            <img src="/products/tote.jpg" alt="Blue canvas tote">
          </a>
          <div class="thin-product-card-body">
            <h2><a href="/products/tote">Canvas tote</a></h2>
            <p class="thin-product-price">$68.00</p>
            <p class="thin-inventory-status">In stock</p>
          </div>
        </article>
      </div>
    </div>
  </div>
</section>

Anatomy

  • Collection header
  • Filter region
  • Result summary
  • Product grid
  • Pagination or empty result

Variants and sizes

  • Neutral theme
  • Thin-Sky theme
  • Intrinsic narrow and wide containers

Gallery coverage: No structured variant fixtures are published yet; the primary example above is the only verified production markup.

Rendered fixtures exercise authored content and constrained layouts with the same production assets.

  • Results
  • Loading
  • Empty
  • Error
  • Filtered
  • Narrow container

Structured state fixtures are not published for this item yet.

Interaction and keyboard behavior

Links and forms own navigation and submission. Optional dialog, media, toast, confirm, or Datastar enhancement may coordinate mechanics but must render returned server truth.

Accessibility

Preserve landmarks, headings, labels, native controls, status text, focus order, image alternatives, and non-color state. Announce only server-confirmed changes.

Contract
COMPOSE
Basis
Native links, headings, forms, lists, and status content; no product-specific APG widget
Evidence
  • tests/unit/library/ecommerce-patterns.test.ts

API

Use semantic HTML with .thin-collection. Keep price, inventory, variants, cart lines, totals, and errors in server-rendered markup.

Behavior tier: datastar-optional

Structured host, property, and example tables are not authored for this item yet. Use the summary above and the primary example.

Fallback

Products, prices, inventory messages, variant choices, and cart actions remain server-authored links, forms, and content without optional enhancement.

Assets and dependencies

  • /foundation.css
  • /layouts.css
  • /components.css
  • /patterns/ecommerce.css
  • /behaviors.js
  • /icons/sprite.svg

Dependencies: quantity-input, rating, toast, confirm-dialog, drawer, product-gallery, lightbox

Source: packages/ui/src/style/ecommerce.ts

Composition

Derived from the examples and style specs, not authored.

Composes