Content Display

Swipe Card Stack

드래그한 카드를 뒤로 보내며 순환시키는 카드 스택입니다.

Preview

content stack

Swipe Card Stack

click cards to send back

house
beach
mountain
home

Installation

bash
Copied
1pnpm dlx shadcn@latest add https://ryong.dev/r/stack.json

Code

typescript
Copied
1import { Stack } from "@/components/stack"23export default function Example() {4  return (5    <div className="h-64 w-64">6      <Stack randomRotation />7    </div>8  )9}

Props

PropTypeDefaultDescription
randomRotationbooleanfalseWhether to rotate cards randomly.
sensitivitynumber200Drag distance required to send card back.
sendToBackOnClickbooleanfalseWhether clicking moves a card back.
cardsReact.ReactNode[]built-in cardsCustom card nodes.
autoplaybooleanfalseWhether the stack cycles automatically.

Reference

ReactBits Swipe Card Stack