kitbash Sign in Connect agent
Components

Featured tile rail

A scroll-snapping rail of white tiles with round prev and next buttons and stretching pill dots.

Part of the style

Charcoal Tile Directory

7 parts that belong together, with their tokens, type and rules.

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --paper: #eee6e6;
  --card: #ded6d6;
  --card-hi: #d0c7c7;
  --well: #130e0e;
  --ink: #010000;
  --ink-soft: #564c4a;
  --ink-faint: #a69d9d;
  --tile: #010000;
  --tile-ink: #eee6e6;
  --tile-soft: #a69d9d;
  --tile-well: #050101;
  --on-accent: #010000;
  --line: rgba(1, 0, 0, 0.08);
  --line-strong: rgba(1, 0, 0, 0.22);
  --glass: rgba(238, 230, 230, 0.82);
  --skeleton: #cac1c1;
  --accent: #c36645;
  --accent-press: #ae5536;
}
</style>

<section class="featured" aria-labelledby="featured-title">
  <h2 class="featured__heading" id="featured-title">Featured objects</h2>
  <ul class="featured__track">
    <li class="featured__tile">
      <a class="featured__link" href="#">
        <span class="featured__pic"><img src="assets/textile.jpg" alt="Woven silk fragment, gold leaves on crimson" width="800" height="492" loading="lazy"></span>
        <span class="featured__meta">
          <span class="featured__fav featured__fav--a" aria-hidden="true">W</span>
          <span class="featured__domain">warpandweft.shop</span>
          <span class="featured__go" aria-hidden="true"><svg viewBox="0 0 12 12"><path d="M3.5 8.5l5-5M4.5 3.5h4v4" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg></span>
        </span>
        <span class="featured__title">Warp &amp; Weft — Woven Remnants by the Yard</span>
        <span class="featured__blurb">Crimson and gold offcuts from old looms, sold flat, measured, and wrapped in brown paper.</span>
      </a>
    </li>
    <li class="featured__tile">
      <a class="featured__link" href="#">
        <span class="featured__pic"><img src="assets/poster-artisan.jpg" alt="Colour lithograph poster with figures in a workshop" width="563" height="800" loading="lazy"></span>
        <span class="featured__meta">
          <span class="featured__fav featured__fav--b" aria-hidden="true">P</span>
          <span class="featured__domain">pressroom.club</span>
          <span class="featured__go" aria-hidden="true"><svg viewBox="0 0 12 12"><path d="M3.5 8.5l5-5M4.5 3.5h4v4" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg></span>
        </span>
        <span class="featured__title">Pressroom — Stone Prints &amp; Shop Posters</span>
        <span class="featured__blurb">Big lithographs from shops that sold chairs, lamps and everything between. Framed or rolled.</span>
      </a>
    </li>
    <li class="featured__tile">
      <a class="featured__link" href="#">
        <span class="featured__pic"><img src="assets/lamp.jpg" alt="Enamelled glass lamp with a flared neck" width="554" height="800" loading="lazy"></span>
        <span class="featured__meta">
          <span class="featured__fav featured__fav--c" aria-hidden="true">G</span>
          <span class="featured__domain">glowhouse.co</span>
          <span class="featured__go" aria-hidden="true"><svg viewBox="0 0 12 12"><path d="M3.5 8.5l5-5M4.5 3.5h4v4" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg></span>
        </span>
        <span class="featured__title">Glowhouse — Lamps That Were Never Plugged In</span>
        <span class="featured__blurb">Enamelled glass, oil wicks and hanging chains. A catalogue of light before the switch.</span>
      </a>
    </li>
    <li class="featured__tile">
      <a class="featured__link" href="#">
        <span class="featured__pic"><img src="assets/vase.jpg" alt="Matte green glazed vase with leaf pattern" width="600" height="800" loading="lazy"></span>
        <span class="featured__meta">
          <span class="featured__fav featured__fav--d" aria-hidden="true">M</span>
          <span class="featured__domain">mossglaze.studio</span>
          <span class="featured__go" aria-hidden="true"><svg viewBox="0 0 12 12"><path d="M3.5 8.5l5-5M4.5 3.5h4v4" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg></span>
        </span>
        <span class="featured__title">Mossglaze — Matte Green, Nothing Else</span>
        <span class="featured__blurb">One kiln, one glaze, one colour. Vases, cups and tiles in the green of wet stone.</span>
      </a>
    </li>
    <li class="featured__tile">
      <a class="featured__link" href="#">
        <span class="featured__pic"><img src="assets/poster-revue.jpg" alt="Lithograph poster of a woman in a spotted coat" width="573" height="800" loading="lazy"></span>
        <span class="featured__meta">
          <span class="featured__fav featured__fav--a" aria-hidden="true">F</span>
          <span class="featured__domain">fortnightly.press</span>
          <span class="featured__go" aria-hidden="true"><svg viewBox="0 0 12 12"><path d="M3.5 8.5l5-5M4.5 3.5h4v4" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg></span>
        </span>
        <span class="featured__title">Fortnightly — Magazine Covers, Twice a Month</span>
        <span class="featured__blurb">Every cover from a little review that ran for ten years, scanned flat and sorted by season.</span>
      </a>
    </li>
  </ul>
  <div class="featured__controls">
    <button class="featured__arrow featured__arrow--prev" type="button" aria-label="Previous"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3.5L5.5 8l4.5 4.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
    <div class="featured__dots" aria-hidden="true"></div>
    <button class="featured__arrow featured__arrow--next" type="button" aria-label="Next"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5L10.5 8 6 12.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
  </div>
</section>

<style>
  .featured {
    --lead: max(var(--edge), (100% - var(--page-width)) / 2);
    padding: var(--space-xl) 0 var(--section-space);
    overflow: hidden;
  }
  .featured__heading {
    margin: 0 var(--lead) var(--space-l);
    font-size: var(--display-m);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: var(--track-display);
  }
  .featured__track {
    display: flex;
    gap: var(--gap);
    margin: 0;
    padding: 0 var(--lead);
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--lead);
    scroll-behavior: smooth;
    scrollbar-width: none;
  }
  .featured__track::-webkit-scrollbar { display: none; }
  .featured__tile {
    flex: 0 0 min(340px, 82vw);
    scroll-snap-align: start;
  }
  .featured__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--space-s) var(--space-s) var(--space-l);
    border-radius: var(--radius-card);
    background: var(--tile);
    color: var(--tile-ink);
    text-decoration: none;
  }
  .featured__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .featured__pic {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--radius-pic);
    background: var(--tile-well);
  }
  .featured__pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--slow) var(--ease);
  }
  .featured__link:hover .featured__pic img { transform: scale(1.04); }
  .featured__meta {
    display: flex;
    align-items: center;
    gap: var(--space-m);
    margin: var(--space-m) 20px var(--space-m);
  }
  .featured__fav {
    display: grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-round);
    color: var(--on-accent);
    font-size: var(--text-xs);
    font-weight: 800;
  }
  .featured__fav--a { background: var(--tile-ink); }
  .featured__fav--b { background: var(--accent); }
  .featured__fav--c { background: var(--tile-soft); }
  .featured__fav--d { background: var(--ink-faint); }
  .featured__domain {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--tile-soft);
    font-size: var(--text-s);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .featured__go {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-round);
    background: var(--tile-well);
  }
  .featured__go svg { width: 12px; height: 12px; transition: transform var(--time) var(--ease); }
  .featured__link:hover .featured__go svg { transform: translate(2px, -2px); }
  .featured__title {
    margin: 0 20px var(--space-s);
    font-size: clamp(24px, 2.6vw, var(--display-m));
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: var(--track-display);
    text-wrap: balance;
  }
  .featured__blurb {
    margin: 0 20px;
    color: var(--tile-soft);
    font-size: var(--text-s);
    line-height: 1.38;
  }
  .featured__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: var(--space-l) var(--lead) 0;
  }
  .featured__arrow {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-round);
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    transition: background-color var(--quick) var(--ease-press), color var(--quick) var(--ease-press), transform var(--quick) var(--ease-press);
  }
  .featured__arrow svg { width: 16px; height: 16px; }
  .featured__arrow:hover { background: var(--card-hi); }
  .featured__arrow:active { transform: scale(0.94); }
  .featured__arrow:disabled { color: var(--ink-faint); cursor: default; }
  .featured__arrow:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
  .featured__dots {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .featured__dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-round);
    background: var(--ink-faint);
    transition: width var(--time) var(--ease-std), background-color var(--time) var(--ease-std);
  }
  .featured__dot.is-active { width: 20px; background: var(--ink); }
  .featured__dot:last-child:not(.is-active) { width: 4px; height: 4px; }
</style>

<script>
(() => {
  for (const root of document.querySelectorAll('.featured')) {
    const track = root.querySelector('.featured__track');
    const tiles = [...track.querySelectorAll('.featured__tile')];
    const dots = root.querySelector('.featured__dots');
    const prev = root.querySelector('.featured__arrow--prev');
    const next = root.querySelector('.featured__arrow--next');
    tiles.forEach(() => { const dot = document.createElement('span'); dot.className = 'featured__dot'; dots.append(dot); });
    const step = () => tiles[1].offsetLeft - tiles[0].offsetLeft;
    const update = () => {
      const max = track.scrollWidth - track.clientWidth;
      const index = track.scrollLeft >= max - 4 ? tiles.length - 1 : Math.round(track.scrollLeft / step());
      [...dots.children].forEach((dot, i) => dot.classList.toggle('is-active', i === index));
      prev.disabled = track.scrollLeft <= 4;
      next.disabled = track.scrollLeft >= max - 4;
    };
    prev.addEventListener('click', () => track.scrollBy({ left: -step() }));
    next.addEventListener('click', () => track.scrollBy({ left: step() }));
    track.addEventListener('scroll', () => requestAnimationFrame(update), { passive: true });
    new ResizeObserver(update).observe(track);
    update();
  }
})();
</script>

Similar components

Line-screen archive

Line-screen archive

City chips picture

City chips picture

Latest work rail

Latest work rail

Colour wash showcase

Colour wash showcase

Creature deck

Creature deck

Project index

Project index

Bracketed Exhibits

Bracketed Exhibits

Night viewer

Night viewer