Browse components
Swipe Stack
A deck of cards you drag away to reveal the next one. Keyboard accessible.
Installation
npx shadcn@latest add @glint-ui/swipe-stackFirst time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glint-ui-seven.vercel.app/r/swipe-stack.json
Usage
import { SwipeStack } from "@/components/ui/swipe-stack";
<SwipeStack cards={photos.map((p) => <img key={p} src={p} alt="" />)} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| cards | ReactNode | — | Array of card nodes. |
| sensitivity | number | 120 | Px of drag to send a card back. |
| offset | number | 10 | Px between stacked cards. |
| className | string | — | Extra classes for the root element. |