<Sortable>
A headless Sortable list component for ReactLynx. It provides list reordering primitives via main-thread animations.
Basic Usage
Drag Without a boundary
If no boundaryId is provided, the SortableItem can be dragged freely without restrictions.
Disable all dragging and sorting behavior
Structure
The whole SortableItem is draggable.
Only the SortableItemArea is draggable.
API
SortableRootProps
boundaryIdiOSAndroidHarmony
The unique key of the item that acts as the boundary. If the item is dragged out of the boundary, the sorting will be canceled.
childreniOSAndroidHarmony
Children, which is a function that receives an item and returns a ReactNode.
dataiOSAndroidHarmony
The data for the sortable list.
debugLogiOSAndroidHarmony
Display debug logs. Open it when you find a bug.
enableSortingiOSAndroidHarmony
Whether to enable sorting.
onSortEndiOSAndroidHarmony
Callback function that is triggered when sorting ends. The parameter is the sorted data.
onSortStartiOSAndroidHarmony
Callback function that is triggered when sorting starts.
SortableItemProps
asiOSAndroidHarmony
Specifies the underlying component to be used.
childreniOSAndroidHarmony
Children.
classNameiOSAndroidHarmony
className
sortingKeyiOSAndroidHarmony
The unique key for sorting.
SortableData
dataItemiOSAndroidHarmony
The original data item.
getSortingKeyiOSAndroidHarmony
A function that returns the unique key for sorting.