React DnD

A set of React hooks and utilities for building complex drag-and-drop interfaces without coupling your components to the DOM.

Library
npm
v16.0.1
21,625 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
53 /100 Fair
Development Activity 0
Maintenance 44
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
79 /100 Good
Architecture 88
Code Quality 82
Innovation 80
Learning Curve 55

React DnD is a drag-and-drop library for React that helps you build sophisticated interfaces like sortable lists, kanban boards, and file drop zones. Rather than wrapping components in opaque widgets, it exposes a set of hooks (useDrag, useDrop, useDragLayer) that let your own components declare what they drag, what they accept, and how they respond, while a framework-agnostic core engine tracks drag state.

It separates the drag-and-drop logic from the rendering backend, shipping HTML5 and touch backends that can be swapped out, and keeps your components testable by moving the imperative browser event handling behind a declarative monitor and connector API.

What You Get

  • The useDrag, useDrop, and useDragLayer hooks for wiring up drag sources, drop targets, and custom drag layers
  • A framework-agnostic dnd-core engine that manages drag state independently of the rendering layer
  • Swappable backends including an HTML5 backend and a touch backend for mobile support
  • A monitor and connector API that keeps browser event handling out of your component code
  • First-class TypeScript types for drag items, collected props, and drop results

Common Use Cases

  • Building sortable lists and reorderable kanban-style boards
  • Implementing file and card drop zones with visual feedback
  • Creating custom drag previews and drag layers decoupled from the DOM
  • Adding drag-and-drop to complex React apps while keeping components unit-testable

Under The Hood

Architecture - React DnD is split into a rendering-agnostic core (dnd-core) and a React binding layer (react-dnd). The core exposes a DragDropManager backed by a small redux store that holds drag state, a HandlerRegistry for registered sources and targets, and a DragDropMonitor for querying state; backends (HTML5, touch) translate raw browser events into core actions. In the React layer, hooks such as useDrag (src/hooks/useDrag) and useDrop compose smaller hooks that register a spec, subscribe a monitor, collect derived props, and return connector refs, keeping React re-renders driven by monitor subscriptions rather than DOM events.

Tech Stack - The library is written in TypeScript and published as a monorepo built with Turborepo and SWC, emitting both ESM and CommonJS bundles plus type declarations. Runtime dependencies are deliberately small: dnd-core for the engine, fast-deep-equal and hoist-non-react-statics, plus internal @react-dnd/invariant and @react-dnd/shallowequal utilities. It targets React 16.14+ via peer dependencies and keeps @types/react optional.

Code Quality - The codebase favors many small, single-responsibility hook modules and typed public APIs, using invariant checks to surface misuse (for example, guarding against the deprecated spec.begin). Testing is real and colocated: tests directories exist across core, internals, and each hook (useDrag, useDrop), exercised with Jest and @testing-library/react plus a dedicated test backend, and coverage is tracked via codecov.

API Design - The public surface is compact and ergonomic: three primary hooks return tuples of collected props and connector refs, and generic parameters let callers type the drag item, collected props, and drop result. The declarative spec object (item, collect, canDrop, drop) reads clearly, though the monitor/connector model and backend setup impose a real conceptual learning curve for newcomers, offset by extensive official docs, tutorials, and examples.

Used by 89 apps in this directory

TypeScript
89%
Other

strapi

CMS

73,368

Open-source headless CMS that auto-generates REST and GraphQL APIs from your content models, with a fully customizable admin panel you control.

View details
93
Repo Health
84
Technical
63
Dependency
Built with
TypeScript 89%
JavaScript 11%
Updated 1 weeks ago
TypeScript
85%
Apache 2.0

superset

AI Code Assistants · AI Development

15,503

Orchestrate an army of AI coding agents—Claude Code, Codex, Gemini CLI, and more—running simultaneously in isolated git worktrees from a single Electron desktop app.

View details
86
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 85%
Updated 6 days ago
TypeScript
85%
Apache 2.0

superset

AI Code Assistants · AI Development

15,503

Orchestrate an army of AI coding agents—Claude Code, Codex, Gemini CLI, and more—running simultaneously in isolated git worktrees from a single Electron desktop app.

View details
86
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 85%
Updated 6 days ago
TypeScript
85%
Apache 2.0

superset

AI Code Assistants · AI Development

15,503

Orchestrate an army of AI coding agents—Claude Code, Codex, Gemini CLI, and more—running simultaneously in isolated git worktrees from a single Electron desktop app.

View details
86
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 85%
Updated 6 days ago
Python
71%
Apache 2.0

SurfSense

AI Assistants · Search

16,586

The open-source, unlimited NotebookLM alternative with real-time collaboration, a desktop app, and no vendor lock-in.

View details
88
Repo Health
71
Technical
66
Dependency
Built with
Python 71%
TypeScript 27%
Updated 6 days ago
Python
71%
Apache 2.0

SurfSense

AI Assistants · Search

16,586

The open-source, unlimited NotebookLM alternative with real-time collaboration, a desktop app, and no vendor lock-in.

View details
88
Repo Health
71
Technical
66
Dependency
Built with
Python 71%
TypeScript 27%
Updated 6 days ago
Go
75%
AGPL 3.0

Teleport

Authentication · Security

21,016

Zero-trust infrastructure access platform that replaces credentials and VPNs with short-lived certificates, SSO, and identity-aware proxies for SSH, Kubernetes, databases, RDP, and AI agents.

View details
94
Repo Health
81
Technical
68
Dependency
Built with
Go 75%
TypeScript 16%
Updated 1 weeks ago
Go
75%
AGPL 3.0

Teleport

Authentication · Security

21,016

Zero-trust infrastructure access platform that replaces credentials and VPNs with short-lived certificates, SSO, and identity-aware proxies for SSH, Kubernetes, databases, RDP, and AI agents.

View details
94
Repo Health
81
Technical
68
Dependency
Built with
Go 75%
TypeScript 16%
Updated 1 weeks ago
TypeScript
98%
Apache 2.0

TinaCMS

CMS

13,845

An open-source, Git-backed headless CMS that gives editors a live visual editing UI over Markdown, MDX, JSON, and YAML content while developers keep everything in version control.

View details
92
Repo Health
74
Technical
59
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers