Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsMay 18, 2026·3 min de lectura

react-beautiful-dnd — Accessible Drag and Drop for React Lists

A drag-and-drop library for React that provides beautiful, accessible list reordering with keyboard and screen reader support out of the box.

Listo para agents

Este activo puede ser leído e instalado directamente por agents

TokRepo expone un comando CLI universal, contrato de instalación, metadata JSON, plan según adaptador y contenido raw para que los agents evalúen compatibilidad, riesgo y próximos pasos.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
react-beautiful-dnd
Comando CLI universal
npx tokrepo install 7cb5f1fe-524e-11f1-9bc6-00163e2b0d79

Introduction

react-beautiful-dnd is a drag-and-drop library by Atlassian designed for reordering lists in React applications. It prioritizes accessibility, natural movement physics, and a declarative API that integrates cleanly with React component patterns.

What react-beautiful-dnd Does

  • Enables vertical, horizontal, and cross-list drag-and-drop reordering
  • Provides full keyboard navigation and screen reader announcements for every drag operation
  • Applies physics-based movement with natural drop animations
  • Supports conditional dragging, droppable placeholders, and scroll containers
  • Works with virtualized lists via community adapters for react-window and react-virtualized

Architecture Overview

The library uses a context-based architecture with three core components: DragDropContext manages global drag state and events, Droppable defines drop zones using render props, and Draggable wraps each item. During a drag, the library calculates displacement maps and applies CSS transforms for performance, avoiding layout thrashing.

Self-Hosting & Configuration

  • Install via npm or yarn and import the three core components
  • Wrap your app or feature area in a single DragDropContext with an onDragEnd callback
  • Define drop targets with Droppable and specify type for cross-list constraints
  • Mark items with Draggable and spread the provided props onto DOM elements
  • Use isDragDisabled on Draggable or isDropDisabled on Droppable for conditional control

Key Features

  • Accessibility-first: ARIA live regions, keyboard shortcuts, and screen reader guidance built in
  • Natural motion with spring physics and drop animation curves
  • Multi-list support for Kanban boards and column-based layouts
  • Auto-scrolling when dragging near container edges
  • Sensor API for programmatic drag triggers in tests and automation

Comparison with Similar Tools

  • dnd-kit — Newer, more flexible, and actively maintained; react-beautiful-dnd is in maintenance mode
  • react-dnd — Lower-level with backend adapters; requires more boilerplate for list reordering
  • SortableJS — Framework-agnostic but React wrapper is less idiomatic than rbd's render-prop API
  • Framer Motion layout — Animation-focused with drag support; not designed for multi-list reordering
  • @hello-pangea/dnd — Community fork of rbd with active development and React 18 support

FAQ

Q: Is react-beautiful-dnd still maintained? A: Atlassian moved the project to maintenance mode in 2023. For new projects, consider @hello-pangea/dnd (a maintained fork) or dnd-kit.

Q: Does it work with React 18? A: It works in most cases but has known issues with StrictMode. The @hello-pangea/dnd fork resolves these.

Q: Can I use it for grid layouts? A: It is optimized for lists. Grid reordering is possible but not a first-class use case; dnd-kit handles grids better.

Q: How do I persist the new order after a drop? A: In the onDragEnd callback, splice the source item into the destination index and update your state or send the new order to your backend.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados