Skip to content

    Browse components

    Tap Flip

    A small flash card that lifts off the table and springs over toward the side you tap, with a shadow that shrinks mid-turn. Enter or Space flips it too.

    Open
    Customize

    Installation

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

    Usage

    import { TapFlip } from "@/components/ui/tap-flip";
    
    <TapFlip
      front="What does the “C” in CSS stand for?"
      back="Cascading."
      onFlip={(showingBack) => track(showingBack)}
    />

    Props

    PropTypeDefaultDescription
    frontstring"What does the “C” in CSS stand for?"Front face content.
    backstring"Cascading. Later rules win when specificity ties."Back face content.
    frontLabelstring"Question"Caption on the front.
    backLabelstring"Answer"Caption on the back.
    colorstring"#818cf8"Accent color of the back face.
    defaultFlippedbooleanfalseStart showing the back.
    flippedReactNode—Controlled flipped state. Pair with onFlip.
    onFlipReactNode—Called with the new state on every flip.
    classNamestring—Extra classes for the root element.