Bencho Originals

Features

  • At rest the photos sit in a neat pile with a slight lean.
  • Point at the deck and it fans out from a pivot near the bottom of the cards.
  • Hovering a card draws it up out of the fan.
  • Click a card and it spins once into the middle, larger, while the rest of the deck drops back.
  • Click anywhere else, or press Escape, and it spins back onto the top of the deck.
  • Scatter adds a messy, hand-dropped tilt to the resting pile.

API reference

<CardStack /> from components/bencho/card-stack.tsx

PropTypeDefaultDescription
cards{ src, alt }[]five photosThe photos in the deck.
countnumber (2–5)5How many of the photos to deal.
spreadnumber (0–100)85How wide the deck fans out.
scatternumber (0–100)0Random tilt and offset in the resting pile.
bouncenumber (0–100)5Spring overshoot.
cornernumber14Card corner radius, px.
onPick(index: number | null) => void—Called with the picked card, or null when it goes back.

Keyboard interactions

TabMoves through the cards and fans the deck out.
Enter / SpaceFlips the focused card into the middle, or puts it back.
EscapePuts the picked card back on top.

Accessibility

  • Each card is a button with aria-pressed and a label naming the photo and what a click will do.
  • A polite live region announces which photo is in the middle.

Sound & haptics

Silent by design: no audio and no vibration. All of the feedback is visual, so it works anywhere, muted or not.

Files

Written from scratch for sher.md and inspired by bencho.dev. It contains none of bencho's code or assets.