# @dnd-kit/helpers

> [![Stable release](https://img.shields.io/npm/v/@dnd-kit/helpers.svg)](https://npm.im/@dnd-kit/helpers)

Latest version **0.5.1** (published 2026-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dnd-kit/helpers
pnpm add @dnd-kit/helpers
yarn add @dnd-kit/helpers
bun add @dnd-kit/helpers
```

## Health

**Score 80/100 (A)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score; popular repo.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2026-10-15 |
| First published | 2024-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 21.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 17745 |
| Maintainers | clauderic |

## Links

- npm: https://www.npmjs.com/package/@dnd-kit/helpers
- Repository: https://github.com/clauderic/dnd-kit
- Homepage: https://github.com/clauderic/dnd-kit#readme
- Issues: https://github.com/clauderic/dnd-kit/issues
- npm.io page: https://npm.io/package/@dnd-kit/helpers

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.6.2
- [@dnd-kit/abstract](https://npm.io/package/@dnd-kit/abstract.md) ^0.5.1

## Recent versions

- 0.5.1 (latest) — 2026-10-15
- 0.5.1-beta-20261015120225 (beta) — 2026-10-15
- 0.5.1-beta-20261015120327 — 2026-10-15
- 0.5.1-beta-20261015120054 — 2026-10-15
- 0.5.1-beta-20261015120014 — 2026-10-15
- 0.5.1-beta-20261015115837 — 2026-10-15
- 0.5.1-beta-20261015115628 — 2026-10-15
- 0.5.1-beta-20261015115554 — 2026-10-15
- 0.5.1-beta-20261015115205 — 2026-10-15
- 0.5.1-beta-20260912195958 — 2026-09-12
- 0.5.1-beta-20260905201412 — 2026-09-05
- 0.5.1-beta-20260905153955 — 2026-09-05
- 0.5.1-beta-20260713030121 — 2026-07-13
- 0.5.1-beta-20260706002929 — 2026-07-06
- 0.5.1-beta-20260627143054 — 2026-06-27
- … 408 more at https://npm.io/package/@dnd-kit/helpers/versions

## README

# @dnd-kit/helpers

[![Stable release](https://img.shields.io/npm/v/@dnd-kit/helpers.svg)](https://npm.im/@dnd-kit/helpers)

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

## Installation

```bash
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

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

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

## Documentation

Visit [dndkit.com](https://dndkit.com) for full documentation.

---
_Source: https://npm.io/package/@dnd-kit/helpers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
