useSortable hook provides everything you need to build sortable interfaces.
Basic Sortable List
Create a simple sortable list by combiningDragDropProvider with useSortable:
move helper automatically calculates the new array order based on the drag operation.
Sortable Grid
Build a sortable grid by adjusting the container layout:Using the Sortable Hook
TheuseSortable hook returns several useful properties and refs:
Drag Handles
Add a drag handle to make only part of the item draggable:Multi-Container Sorting
Create sortable items that can move between different lists using groups:Disabling Sortable Items
Disable specific items from being dragged or accepting drops:Custom Data
Attach custom data to sortable items:Advanced: Separate Source and Target
For complex layouts, you can specify different elements for the draggable source and drop target:Next Steps
1
Customize Transitions
Learn how to configure animations and transitions for smooth sorting effects
2
Add Accessibility
Ensure your sortable lists are accessible with keyboard navigation
3
Optimize Performance
Improve rendering performance for large lists with optimization techniques