Skip to content

    Browse components

    Deck Cycle

    A skewed 3D stack of cards that cycles on its own: the front card drops away and springs back in behind the others.

    Open
    Customize
    elastic
    smooth

    Installation

    npx shadcn@latest add @glint-ui/deck-cycle

    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/deck-cycle.json

    Usage

    import { DeckCycle } from "@/components/ui/deck-cycle";
    
    <DeckCycle cards={[<div key="a">One</div>, <div key="b">Two</div>, <div key="c">Three</div>]} />

    Props

    PropTypeDefaultDescription
    cardsReactNode—Array of card nodes.
    widthnumber340Card width in px.
    heightnumber240Card height in px.
    distanceXnumber56Horizontal px between cards.
    distanceYnumber56Vertical px between cards.
    skewnumber6Stack skew in degrees.
    delaynumber3500Ms between swaps.
    pauseOnHoverbooleantruePause while hovered.
    easing"elastic" | "smooth""elastic"Motion style.
    classNamestring—Extra classes for the root element.