Swipe Deck

01Swiss gridDrag me sideways
02BauhausForm follows function
03BrutalismRaw and honest
04MemphisLoud on purpose
No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/card-swipe-deck

About this component

A deck of cards you fling. Drag the top card and it tilts with the throw while a Keep or Skip stamp fades in by direction; let go far enough and it flies off and tucks in at the back of the deck as the next card rises. Arrow keys swipe too.

Triggers

  • Click
  • Spring
  • Card
  • Mouse tracking

Techniques

  • CSS variables
  • Event position
  • Spring
  • State machine

Difficulty

Intermediate

Accessibility

Keyboard and screen readers

The deck is a focusable group: Left and Right arrows swipe the top card. Cards below the top are aria-hidden.

Reduced motion

Cards move without animation.

Use it in anything you build, commercial and client work included. Licence

More cards

See all
01PlanSketch the flow
02BuildMake it move
03ShipWatch it land
Field GuideHover to open
Tri-foldGet code
Aurora
Floating light blobs
AuroraGet code
Border Glow
Conic gradient spin
Border GlowGet code