Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@dnd-kit/helpers

Stable release

Framework-agnostic helper functions for @dnd-kit. Provides utilities for common data transformations in drag and drop interactions.

Installation

npm install @dnd-kit/helpers

API

Function Description
move(items, event) Move an item from one position to another within a flat or grouped collection
swap(items, event) Swap the positions of two items
arrayMove(array, from, to) Move an item in an array from one index to another
arraySwap(array, from, to) Swap two items in an array by index

Example

import {move} from '@dnd-kit/helpers';

function onDragEnd(event) {
  items = move(items, event);
}

Documentation

Visit dndkit.com for full documentation.