<SwipeAction>
A SwipeAction component for ReactLynx. It provides swipeable list item primitives via main-thread gestures.
-
Key Composition:
-
displayArea: Visible content section
-
actionArea: Hidden actionable area (e.g. for swipe-to-delete functionality)
-
Use Cases:
-
Implement swipe gestures (e.g. delete/archive actions)
-
Build interactive touch controls
Requirements
LynxSDK version >= 2.16
@lynx-js/react version > 0.24
Info
You can check the source code to understand how it works, and you're welcome to submit MRs to enhance its capabilities.
SwipeActionProps
actionAreaiOSAndroid
Action area of the SwipeAction. The content of this area will be displayed on the right side of the SwipeAction. Before swipe or showActionArea called, this area will be hidden.
childreniOSAndroid
The content of the SwipeAction. The content will be displayed on the left side of the SwipeAction.
classNameiOSAndroidHarmony
className
debugLogiOSAndroid
Display debug logs. Open it when you find a bug.
displayAreaiOSAndroid
Display area of the SwipeAction. The content of this area will be displayed on the left side of the SwipeAction.
enableSwipeiOSAndroid
Whether allow swipe action. When it set to false, this item can only be used to display content.
estimatedActionAreaSizeiOSAndroid
The size of the action area. If the swipeAction is used inside List, the reuse of the List may cause the actionArea to have wrong size. You can use this property to set the initial size of the actionArea.
iosEnableSimultaneousTouchiOS
Force touch event to send to SwipeAction.
onActioniOSAndroid
Triggered when the actionArea was tapped. Can be used to delete or other actions.
onSwipeEndiOSAndroid
Triggered when the SwipeAction swipe ends.
onSwipeStartiOSAndroid
Triggered when the SwipeAction is swiped.
ref
styleiOSAndroidHarmony
style
swipeActionIdiOSAndroid
Id of the SwipeAction. The onSwipeStart, onSwipeEnd and onAction will be called with this id.
SwipeActionRef
closeActionAreaiOSAndroid
Call to hide the actionArea. If animated is true, the actionArea will be hidden with animation.
showActionAreaiOSAndroid
Call to display the actionArea. If animated is true, the actionArea will be displayed with animation.