components / shelf

shelf.

horizontally scrolling row of cards — the browsable counterpart to gallery's searchable grid. arrows appear only once the row genuinely overflows (measured, not assumed) and disable at their end; scrolling stays native, so trackpad, touch and keyboard all work untouched.

playlists
8
late shift
12 tracks
rain on the window
16 tracks
second coffee
20 tracks
the long way round
24 tracks
nothing at all
28 tracks
closing up
32 tracks
four in the morning
36 tracks
walk it off
40 tracks
wider items, no snap
01
late shift
02
rain on the window
03
second coffee
04
the long way round
05
nothing at all

the arrows only exist while the row overflows — narrow the window and watch them appear.

installation
bunx @justin06lee/chrome@latest add shelf
props
nametypedefaultdescription
children *ReactNode-the cards; each is given itemWidth and made unshrinkable.
titleReactNode-mono uppercase heading above the row.
actionReactNode-right-hand slot on the title line — a 'see all' link, a count.
itemWidthnumber176width of each item in px.
gapnumber16
arrowsbooleantruepaging buttons, shown only when the row overflows.
snapbooleantruesnap each item to the left edge as you scroll.
ariaLabelstring-accessible name for the scroll region; falls back to title when it's a string.
classNamestring-