Choose your framework
dnd-kit provides framework-specific adapters for React, Vue, Svelte, SolidJS, and vanilla JavaScript. Choose the installation instructions for your framework:- React
- Vue
- Svelte
- SolidJS
- Vanilla JS
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:
closestCenter- Finds the droppable closest to the center of the draggableclosestCorners- Measures distance to all four cornersrectangleIntersection- Detects overlapping rectanglesdirectionBiased- Optimized for sortable lists
Helpers
Utility functions for common operations: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:- React
- DOM
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
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:Next steps
Quick start guide
Build your first drag and drop interface with our step-by-step guide