<Draggable>
A headless Draggable component for ReactLynx. It provides drag-and-drop primitives via main-thread execution.
Basic Usage
Draggable supports two gesture modes: immediate (drag starts instantly on touch) and longpress (drag starts after a long press gesture).
You can also control whether the position resets when the drag ends or preserves its transform position.
With bounds
The draggable area allowed can be limited with min(max)TranslateX/Y props.
Structure
The whole component is draggable.
Only the DraggableArea accepts the dragging gesture.
API
Draggable
allowedDirectioniOSAndroidHarmony
The direction of the drag.
childreniOSAndroidHarmony
children
classNameiOSAndroidHarmony
className
debugLogiOSAndroidHarmony
Display debug logs. Open it when you find a bug.
draggablePropsiOSAndroidHarmony
Extra props for draggable. It accepts all the props of the normal view.
enableDraggingiOSAndroidHarmony
Whether the component is draggable.
idiOSAndroidHarmony
Id
maxTranslateXiOSAndroidHarmony
The maximum value of the X-axis translation.
maxTranslateYiOSAndroidHarmony
The maximum value of the Y-axis translation.
minTranslateXiOSAndroidHarmony
The minimum value of the X-axis translation.
minTranslateYiOSAndroidHarmony
The minimum value of the Y-axis translation.
MTSRefiOSAndroidHarmony
main-thread:ref
onDragEndiOSAndroidHarmony
Triggers when the drag is over
onDraggingiOSAndroidHarmony
Triggers when the item is dragging
onDragStartiOSAndroidHarmony
Triggers when the item starts to be dragged
onMTSDragEndiOSAndroidHarmony
Triggered when the dragging ends. It runs on the main thread, allowing for more timely UI operations. Please ensure that the passed handler is a main thread function, i.e., a function marked with 'main thread'.
onMTSDraggingiOSAndroidHarmony
Triggered when the dragging ends. It runs on the main thread, allowing for more timely UI operations. Please ensure that the passed handler is a main thread function, i.e., a function marked with 'main thread'.
onMTSDragStartiOSAndroidHarmony
Triggered during the dragging process. It runs on the main thread, allowing for more timely UI operations. Please ensure that the passed handler is a main thread function, i.e., a function marked with 'main thread'.
resetOnEndiOSAndroidHarmony
Reset the transform to 0 when the dragging process ends.
styleiOSAndroidHarmony
style
triggeriOSAndroidHarmony
The way to trigger the drag.
DraggableArea
childreniOSAndroidHarmony
children
classNameiOSAndroidHarmony
className
idiOSAndroidHarmony
Id
styleiOSAndroidHarmony
style