Skip to content

    Browse components

    Swipe Stack

    A deck of cards you drag away to reveal the next one. Keyboard accessible.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/swipe-stack

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.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

    PropTypeDefaultDescription
    cardsReactNode—Array of card nodes.
    sensitivitynumber120Px of drag to send a card back.
    offsetnumber10Px between stacked cards.
    classNamestring—Extra classes for the root element.