Stack

The stack preset, a wallet you flick through.

A wallet. The deck waits below and behind, each card showing a strip of itself under the one in front, and the card you pass pulls up and out of the way.

stack({ offset: 26, slide: 104, depth: 40 })
ts
import { createPicker } from 'loopem'
import { stack } from 'loopem/layouts'

createPicker(el, {
  items,
  renderItem,
  ...stack(),
})

The demo above is scaled to 72px cards, so it passes smaller numbers than the bare call does.

Tuning it

OptionDefaultWhat it does
slide140Pixels the card being passed travels as it clears the deck.
offset34Pixels of each waiting card left showing under the last.
depth50Pixels each waiting card recedes.
shrink0.05How much each waiting card narrows.
reach4Cards deep before one is out of sight behind the deck.
perspective900Distance to the vanishing point.

It sets axis: 'vertical' itself.

Why the deck points down

On a vertical track the next item is the one below, so a deck stacked upwards would move against your finger: you would drag down and watch the cards go up. That is why the deck sits below the front card.