Programmatic Actions
Programmatic actions come from useDeckActions(). Use them for buttons,
external controls, or any app logic that should dismiss the active card.
swipeUp() is accepted only when the Root explicitly includes 'up' in
allowedDirections. Gesture up also requires free drag mode; programmatic
swipeUp() is still available when drag mode is horizontal.
Action Motion
motion controls manual drag feel. actionMotion controls only programmatic
actions such as swipeLeft(), swipeRight(), and swipeUp().
Recipes
SwipeDeckActionMotion.direct(options?)
Dismisses immediately toward the action direction. Omitted values reuse the deck's resolved dismiss duration, easing, and offscreen multiplier.
SwipeDeckActionMotion.springboard(options?)
Moves a little in the opposite direction first, then dismisses offscreen. During anticipation, swipe progress and live direction stay neutral so opposite-side overlays do not flash.
Precedence
actionMotion is replacement-based, not deep-merged:
- factory
actionMotionfromcreateSwipeDeck({ actionMotion }) Root actionMotion, replacing the factory default for that Root- per-call recipe passed to
swipeLeft(recipe),swipeRight(recipe), orswipeUp(recipe)
Actions are callback-safe. If a React Native press event is passed to
swipeRight, swipeLeft, or swipeUp, the event argument is ignored and the
configured action motion is used.
