Skip to content

    Browse components

    Flip Stack

    A pile of cards where clicking tosses the top card up, flips it end over end and drops it behind the pile as the rest step forward.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/flip-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/flip-stack.json

    Usage

    import { FlipStack } from "@/components/ui/flip-stack";
    
    <FlipStack
      cards={photos.map((src) => <img src={src} alt="" className="size-full object-cover" />)}
      back={<CardBack />}
    />

    Props

    PropTypeDefaultDescription
    cardsReactNode—Array of card faces, top first.
    backReactNode—Shared back face shown mid-flip.
    offsetnumber16Px each card behind peeks out.
    scaleStepnumber0.06Scale lost per card of depth.
    visiblenumber3Cards visible in the pile.
    liftnumber0.4Toss height as a fraction of card height.
    durationnumber0.9Seconds per flip.
    widthnumber240Card width in px.
    heightnumber300Card height in px.
    labelstring—Accessible name for the stack.
    onChangeReactNode—Called with the index of the new top card.
    classNamestring—Extra classes for the root element.