Skip to main content

Choose your framework

dnd-kit provides framework-specific adapters for React, Vue, Svelte, SolidJS, and vanilla JavaScript. Choose the installation instructions for your framework:
Install the React adapter along with its peer dependencies.

Peer dependencies

The React adapter requires React 18.0.0 or higher:
package.json
dnd-kit is compatible with both React 18 and the latest React 19.

Optional packages

Depending on your use case, you may want to install additional packages:

Sortable

If you’re building sortable lists, the sortable functionality is included in the framework adapters:
The sortable module is included in the framework adapters—no additional installation required.

Collision detection

Advanced collision detection algorithms are available in the @dnd-kit/collision package:
This package provides algorithms like:
  • closestCenter - Finds the droppable closest to the center of the draggable
  • closestCorners - Measures distance to all four corners
  • rectangleIntersection - Detects overlapping rectangles
  • directionBiased - Optimized for sortable lists

Helpers

Utility functions for common operations:
Provides helpers like move() for reordering arrays:

Geometry

Geometry utilities for calculating positions and distances:

Package exports

Each framework adapter provides multiple entry points for tree-shaking optimization:
The React package exports are organized by feature:
All exports are available in both ESM and CommonJS formats:
package.json

TypeScript support

All dnd-kit packages are written in TypeScript and include type definitions:
No additional @types packages needed—types are included in each package.

Version compatibility

All dnd-kit packages follow semantic versioning. When installing multiple packages, ensure they’re on compatible versions:
package.json
Always use the same minor version across all @dnd-kit packages to avoid compatibility issues.

Bundler configuration

Next.js

dnd-kit works seamlessly with Next.js 13+ and the App Router. All components are marked with 'use client' where needed:
app/page.tsx

Vite

No special configuration needed for Vite. The library works out of the box:

Webpack

For Webpack 5, ensure you’re using the latest version. No additional configuration required.

Verify installation

Create a simple test to verify your installation:
If this renders without errors, you’re ready to go!

Next steps

Quick start guide

Build your first drag and drop interface with our step-by-step guide