Basic Usage
Factory API
The factory API is the primary API. Use it when a deck needs hooks, actions, events, interaction shared values, or multiple named instances.
The factory keeps Root, Card, and hooks on the same item type without
repeating generics in JSX.
Card Render Info
Card receives render info for each mounted item.
Allowed Directions
allowedDirections limits which directions can be accepted as a dismiss.
- Omit
allowedDirectionsto allow both directions. - Pass
['left']or['right']to allow only one dismiss direction. - Pass
[]to allow dragging but reject every dismiss release and programmatic swipe action.
Static API
Use the static API only when you need inline card rendering and do not need factory hooks.
Static Root does not accept id, and static Root / Card do not share a
factory type. Pass the item type to Card when you want typed render props.
