Swipe Cards

Tinder-style card stack. Drag the top card left or right past the threshold to swipe it away; the cards behind move up as you drag.

Import

import { SwipeCards } from "@igorao79/uivix";

Examples

Default

Drag with mouse or touch

🛸
Glitch
Never met a bug they couldn't scramble.
âš¡
Neon
Ships animations at 60fps.
👾
Pixel
Speaks fluent CSS grid.
🌌
Aurora
Loves gradients and late-night deploys.
LikeNope
Swipes
—

Props

PropTypeDefaultDescription
cardsSwipeCardItem[]-Initial stack { id, content }, top card first. Change key to reset
onSwipe(card, direction) => void-Called after a card leaves the stack
thresholdnumber110Drag distance in px needed to swipe
loopbooleanfalsePut swiped cards back at the bottom
visiblenumber3Cards visible in the stack
emptyStateReactNode-Shown when the stack is empty
classNamestring-Size and other classes (default h-80 w-64)