Skip to content

    Browse components

    Card Flip

    A 3D card that springs over to reveal its back on hover or click, with Enter/Space to toggle.

    Open
    Customize
    hover
    click
    horizontal
    vertical

    Installation

    npx shadcn@latest add @glint-ui/card-flip

    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/card-flip.json

    Usage

    import { CardFlip } from "@/components/ui/card-flip";
    
    <CardFlip
      front={<img src="/kyoto.jpg" alt="Kyoto" />}
      back={<TripDetails />}
      trigger="click"
    />

    Props

    PropTypeDefaultDescription
    frontReactNode—Front face content.
    backReactNode—Back face content.
    trigger"hover" | "click""hover"What flips the card.
    direction"horizontal" | "vertical""horizontal"Flip axis.
    durationnumber700Flip duration in ms.
    widthnumber280Card width in px.
    heightnumber380Card height in px.
    labelstring—Accessible name; defaults to the visible face text.
    classNamestring—Extra classes for the root element.