Navigate:
React Beautiful DnD
~$BEAU0.0%

react-beautiful-dnd: Drag and drop for React lists

Accessible React library for list drag-and-drop interactions.

LIVE RANKINGS • 02:56 PM • STEADY
OVERALL
#428
20
FRONTEND
#39
1
30 DAY RANKING TREND
ovr#428
·Front#39
STARS
34.0K
FORKS
2.7K
7D STARS
+3
7D FORKS
-4
See Repo:
Share:

Learn more about React Beautiful DnD

react-beautiful-dnd is a React component library that provides drag and drop functionality for list-based interfaces. It uses a sensor-based architecture to handle mouse, keyboard, and touch input, with a declarative API built around Draggable and Droppable components. The library implements accessibility features including keyboard navigation and screen reader announcements without requiring additional DOM wrapper nodes. Common use cases include reordering lists, moving items between lists, and implementing sortable interfaces in web applications.

React Beautiful DnD

1

Zero-Wrapper DOM Structure

Implements drag and drop without injecting extra DOM elements that break layouts. Preserves flexbox and CSS grid compatibility while maintaining native focus management and accessibility tree structure.

2

Built-in Accessibility Support

Includes keyboard navigation and screen reader announcements out of the box with customizable internationalization. Handles ARIA attributes and focus management automatically without additional configuration.

3

Virtual List Compatibility

Integrates with virtualized list libraries like react-window for performant drag-and-drop in lists with thousands of items. Maintains smooth 60fps interactions even when only visible items are rendered to the DOM.


import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';

function TaskList({ tasks }) {
  const handleDragEnd = (result) => {
    if (!result.destination) return;
    const items = Array.from(tasks);
    const [reordered] = items.splice(result.source.index, 1);
    items.splice(result.destination.index, 0, reordered);
  };

  return (
    <DragDropContext onDragEnd={handleDragEnd}>
      <Droppable droppableId="tasks">
        {(provided) => (
          <ul {...provided.droppableProps} ref={provided.innerRef}>
            {tasks.map((task, index) => (
              <Draggable key={task.id} draggableId={task.id} index={index}>
                {(provided) => (
                  <li ref={provided.innerRef} {...provided.draggableProps} {...provided.dragHandleProps}>
                    {task.content}
                  </li>
                )}
              </Draggable>
            ))}
            {provided.placeholder}
          </ul>
        )}
      </Droppable>
    </DragDropContext>
  );
}


vv13.1.1

Adds React v18 support via peerDependency with documentation improvements.

  • Adds react v18 to the list of supported react versions via peerDependency
  • Various dependency bumps
  • Various changes to documentation
vv13.1.0

Adds individual sensor imports and React 17 support with improved event handling.

  • You can now import default sensors as `useMouseSensor`, `useKeyboardSensor`, or `useTouchSensor` for individual reuse via `sensors` prop
  • React 17 is now supported
  • Removed redundant event listener
vv13.0.0

Major release fixing polyfilling issues and improving screen reader accessibility.

  • Babel changes: no more unintentional polyfilling!
  • More reliable on focus messaging. Verified on VoiceOver, JAWS and NVDA screen readers
  • DragDropContext | liftInstruction
  • DragDropContext | dragHandleUsageInstructions
  • DragHandleProps | aria-labelledby


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers