Skip to content

dnd-kit

A toolkit for building drag and drop interfaces on the web, with adapters for several frameworks.

Stars
17.8k
Forks
929
Licence
MIT
Language
TypeScript
Last update
6 days ago
Type
Library

What it is

dnd-kit is a set of JavaScript packages that let developers add drag and drop to web pages and apps. It has a framework-agnostic core and a DOM layer, plus thin adapters for React, Vue, Svelte, and SolidJS, with plain JavaScript also supported. It is used to build things like sortable lists, grids, and multi-container layouts.

  • Reorder items in a sortable list with mouse, touch, or keyboard
  • Move cards between multiple containers, such as a kanban board
  • Build a grid layout where items can be rearranged
  • Create a 2D drag interaction for a simple game

Great for

  • Developers building sortable lists or grids in a React, Vue, Svelte, or Solid app
  • Teams that want keyboard and screen reader support built into drag and drop
  • Developers who need to customize sensors, collision detection, or animations
  • Projects that want a lightweight, MIT-licensed drag and drop dependency

Not ideal for

  • Non-programmers looking for a ready-made tool; it is a code library that must be integrated into a project
  • Projects that only need simple file upload drop zones, since the README focuses on element dragging and does not cover that case
Step-by-step guide: how to use dnd-kitInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js or a compatible JavaScript runtime · A package manager such as npm, pnpm, yarn, or bun

    Clone the repository (contributors)

    git clone https://github.com/clauderic/dnd-kit

    Install dependencies (monorepo, from README)

    bun install

    Build all packages

    bun run build
  2. 2

    Run it

    • Pick your framework from the quickstart guides at dndkit.com
    • Install the matching adapter package from npm, such as @dnd-kit/react
    • Follow the quickstart to set up a draggable and droppable element
    • Visit dndkit.com for interactive examples
  3. 3

    Get the most out of it

    • Use @dnd-kit/dom/sortable for sortable interfaces, as it is built on the core
    • Use the collision and helpers packages for collision detection and utilities
    • Customize screen reader instructions and live regions for accessibility
    • Build custom sensors or key bindings if the defaults do not fit your interaction

Downloads

Strengths

  • Supports pointer, mouse, touch, and keyboard input out of the box
  • Framework-agnostic core with adapters for several popular frameworks
  • Ships with default ARIA attributes and customizable screen reader instructions

Trade-offs

  • As a toolkit, it requires writing code and understanding its layered package structure
  • The README is truncated and points to external docs for full API details, so this entry relies on limited information

How it compares

ProjectStarsTypeLevelUpdatedBest for
dnd-kit (this)17.8kLibraryintermediate6 days agoDevelopers building sortable lists or grids in a React, Vue, Svelte, or Solid app
react-dnd21.6kLibraryintermediate1.3 years agoReact developers building interfaces with draggable items such as lists, boards or sortable elements
interact.js12.9kLibraryintermediate3 months agoWeb developers building drag-and-drop interfaces
Sortable31.2kLibrarybeginner8 months agoWeb developers adding reorderable lists to a site or app
draggable18.5kLibraryintermediate11 months agoFront-end developers who want full control over how drag and drop feels and behaves
muuri10.9kLibraryintermediate2.5 years agoFront-end developers building card or photo grids that need drag and drop or filtering

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.