API Reference
Main Exports
createSwipeDeck<T>(config?)
Creates a typed deck family.
The returned instance includes:
RootCarduseDeckStateuseDeckActionsuseDeckInteractionuseDeckEventuseDeckEventListener
SwipeDeck.Root Props
Static SwipeDeck.Root accepts the same props except id.
See Multi-Instance Management for the complete id contract.
id is not an item key. Use a stable deck namespace such as "nearby",
"recommended", or a navigation route key that does not change while the screen
is mounted. Identity is stable while at least one committed Root or public hook
consumer remains mounted for that id. After the final cleanup and deferred
eviction, a later consumer receives fresh actions and interaction shared values.
Do not derive ids from item ids, timestamps, or values that change while mounted.
Two simultaneous Roots from the same factory still require distinct ids.
SwipeDeck.Card Props
SwipeRenderInfo<T> includes item, index, offset, role, and
isActive.
State And Actions
Programmatic actions return boolean to tell whether the action was accepted.
Interaction
SwipeDirection is 'left' | 'right' | 'up'. Omitted allowedDirections
allows only left and right; upward dismisses are opt-in.
useDeckInteraction() returns Reanimated shared values for progress,
signedProgress, direction, intentDirection, dismissDirection,
translationX, translationY, isDragging, and phase. intentDirection
is the policy-filtered live semantic source for overlays: 'left', 'right',
'up', or null. Only centered upward gestures enter the internal up cone;
ordinary upper-left and upper-right diagonals remain horizontal. If that raw
horizontal winner is not allowed, intentDirection, progress, and
signedProgress stay neutral while card translation still follows the finger.
signedProgress and numeric direction remain horizontal-only and are 0 for
upward intent or dismiss. dismissDirection can be 'left', 'right', 'up',
or null after a dismiss is accepted.
Events
Use useDeckEvent for latest event snapshots and useDeckEventListener for
imperative subscriptions.
Motion Helpers
SwipeDeckMotion.tinder(options?)SwipeDeckActionMotion.direct(options?)SwipeDeckActionMotion.springboard(options?)SwipeDeckUndoMotion.spring(options?)SwipeDeckUndoMotion.timing(options?)
For behavior details, prefer the guide pages over treating this reference as an onboarding surface.
