Reel layout

릴 레이아웃

A single row that scrolls horizontally without ever wrapping — the classic shape of a Netflix thumbnail row.

Also known as: Every Layout ReelHorizontal scroller
···
html
<div class="frame">
  <div class="reel" id="reel">
    <div class="card">1</div><div class="card">2</div><div class="card">3</div>
    <div class="card">4</div><div class="card">5</div><div class="card">6</div>
  </div>
</div>
css
.frame{width:min(80%,440px);box-sizing:border-box;border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--bg)}
.reel{display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent);
  mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent)}
.reel::-webkit-scrollbar{display:none}
.card{flex:0 0 auto;width:64px;height:64px;border-radius:10px;background:var(--accent);scroll-snap-align:start;
  display:grid;place-items:center;color:#fff;font-weight:800;font-size:16px}
.card:nth-child(even){background:var(--accent-3)}
js
const reel = document.getElementById('reel');
let dir = 1;
function tick() {
  const max = reel.scrollWidth - reel.clientWidth;
  reel.scrollLeft += dir * 0.7;
  if (reel.scrollLeft >= max - 1) dir = -1;
  if (reel.scrollLeft <= 1) dir = 1;
  requestAnimationFrame(tick);
}
requestAnimationFrame(tick);

The basics: display: flex plus overflow-x: auto, with every child set to flex: 0 0 auto — never shrinking, never growing, always its own size. Without flex-wrap, items never drop to a new line, so once their combined width exceeds the container, the overflow becomes horizontal scroll.

Add scroll-snap-type: x mandatory to the parent and scroll-snap-align: start to each child, and scrolling comes to rest exactly on an item boundary — no drag or swipe stops halfway. The scrollbar itself is commonly hidden with scrollbar-width: none (Firefox) and ::-webkit-scrollbar { display: none } (Chromium), replaced by a mask-image gradient at both edges that hints "there's more to scroll" without a visible bar.

A vertical reel — a stories list, say — works the same way with the axis flipped. Since keyboard and screen-reader users still need to reach every item one at a time, anything beyond a purely decorative carousel needs each item to be a focusable element (a link or a button), or the pattern quietly breaks accessibility.

When to use

Good for recommendation rails, category tabs, or gallery thumbnails — item counts that vary and don't all need to be visible at once. Not a fit for core navigation where every item must always be seen.