Swipe Cards

Stacked deck: drag, flick, tap or arrow-key cards away with keep/pass stamps; the deck springs forward and every swipe is announced. Fades instead of flying under reduced motion.

Try it: Drag or flick the top card, or focus the deck and press ← / →.

Installation

Install with the shadcn CLI:

npx shadcn@latest add https://www.framekitui.live/r/swipe-cards.json

Or, with the @framekit namespace registered: npx shadcn@latest add @framekit/swipe-cards. You can also copy the source into components/ui/swipe-cards.tsx (view on GitHub).

Usage

import { SwipeCards } from '@/components/ui/swipe-cards'

Props

Component props
PropTypeDefaultNotes
cards{ id, title, subtitle?, color }[]—color accepts any CSS background (colours or gradients).
onSwipe(card, 'left' | 'right') => void—Fires after a card leaves.
showControlsbooleantruePass / reset / keep buttons.
labels{ left, right }{ left: 'Pass', right: 'Keep' }Words for stamps, buttons and announcements.

Dependencies

  • motion
  • lucide-react
  • Border Beam

    A comet of light travels a crisp masked hairline border, with an optional soft bloom. Static under reduced motion.

  • Glass Card

    Liquid-glass surface with specular rim, inner hairline and layered depth; regular (frosted) or clear variants, and a solid fallback for prefers-reduced-transparency.

  • Pixel Reveal

    Image or generated art dissolves in through a shrinking pixel grid when scrolled into view — random, diagonal or centre-out — with an optional replay.

  • Tilt Card

    Spring-damped 3D tilt with real perspective, a soft specular glare and a gentle lift. Mouse only; static under reduced motion.

  • Hologram Flip Card

    Flip to holographic rear with iridescent sheen.

  • Spotlight Card

    Radial glow and a lit hairline edge that track your pointer (CSS variables, no re-renders); keyboard focus inside lights it too.

See all 27 Cards components