react-beautiful-dnd

Beautiful and accessible drag and drop for lists with React

README


⚠️ Maintenance & support


This library continues to be relied upon heavily by Atlassian products, but we are focused on other priorities right now and have no current plans for further feature development or improvements.

It will continue to be here on GitHub and we will still make critical updates (e.g. security fixes, if any) as required, but will not be actively monitoring or replying to issues and pull requests.

We recommend that you don’t raise issues or pull requests, as they will not be reviewed or actioned until further notice.


react beautiful dnd logo

react-beautiful-dnd (rbd)


Beautiful and accessible drag and drop for lists with [React](https://facebook.github.io/react/)
CircleCI branch npm

quote application example



Core characteristics


- Beautiful and natural movement of items 💐
- Accessible: powerful keyboard and screen reader support ♿️
- Clean and powerful api which is simple to get started with
- Plays extremely well with standard browser interactions
- No creation of additional wrapper dom nodes - flexbox and focus management friendly!

Get started 👩‍🏫


We have created [a free course on egghead.io 🥚](https://egghead.io/courses/beautiful-and-accessible-drag-and-drop-with-react-beautiful-dnd) to help you get started with react-beautiful-dnd as quickly as possible.
course-logo

Currently supported feature set ✅


- Vertical lists ↕
- Horizontal lists ↔
- Movement between lists (▤ ↔ ▤)
- Virtual list support 👾 - unlocking 10,000 items @ 60fps
- Mouse 🐭, keyboard 🎹♿️ and touch 👉📱 (mobile, tablet and so on) support
- Incredible screen reader support ♿️ - we provide an amazing experience for english screen readers out of the box 📦. We also provide complete customisation control and internationalisation support for those who need it 💖
- Multiple independent lists on the one page
- Flexible item sizes - the draggable items can have different heights (vertical lists) or widths (horizontal lists)
- Compatible with semantic `` reordering - [table pattern](/docs/patterns/tables.md)
- Auto scrolling - automatically scroll containers and the window as required during a drag (even with keyboard 🔥)
- Custom drag handles - you can drag a whole item by just a part of it
- Able to move the dragging item to another element while dragging (clone, portal) - [Reparenting your ``](/docs/guides/reparenting.md)
- Allows extensions to support for any input type you like 🕹
- 🌲 Tree support through the [@atlaskit/tree](https://atlaskit.atlassian.com/packages/confluence/tree) package
- A `` list can be a scroll container (without a scrollable parent) or be the child of a scroll container (that also does not have a scrollable parent)
- Independent nested lists - a list can be a child of another list, but you cannot drag items from the parent list into a child list
- Server side rendering (SSR) compatible - see resetServerContext()
- Plays well with nested interactive elements by default

Motivation 🤔


react-beautiful-dnd exists to create beautiful drag and drop for lists that anyone can use - even people who cannot see. For a good overview of the history and motivations of the project you can take a look at these external resources:


Not for everyone ✌️


There are a lot of libraries out there that allow for drag and drop interactions within React. Most notable of these is the amazing [react-dnd](https://github.com/react-dnd/react-dnd). It does an incredible job at providing a great set of drag and drop primitives which work especially well with the wildly inconsistent html5 drag and drop feature.react-beautiful-dnd is a higher level abstraction specifically built for lists (vertical, horizontal, movement between lists, nested lists and so on). Within that subset of functionality react-beautiful-dnd offers a powerful, natural and beautiful drag and drop experience. However, it does not provide the breadth of functionality offered by react-dnd. So react-beautiful-dnd might not be for you depending on what your use case is.

Documentation 📖


About 👋



Sensors 🔉


The ways in which somebody can start and control a drag


- Create your own sensor (allows for any input type as well as scripted experiences)

API 🏋️‍


diagram

- [``](/docs/api/drag-drop-context.md) - _Wraps the part of your application you want to have drag and drop enabled for_- [``](/docs/api/droppable.md) - _An area that can be dropped into. Contains ``s_- [``](/docs/api/draggable.md) - _What can be dragged around_
- [resetServerContext()](/docs/api/reset-server-context.md) - _Utility for server side rendering (SSR)_

Guides 🗺


- [`` responders](/docs/guides/responders.md) - _`onDragStart`, `onDragUpdate`, `onDragEnd` and `onBeforeDragStart`_- [Combining ``s](/docs/guides/combining.md)
- [Using innerRef](/docs/guides/using-inner-ref.md)
- [Rules for draggableId and droppableIds](/docs/guides/identifiers.md)
- [Use the html5 doctype](/docs/guides/doctype.md)
- [TypeScript and flow: type information](/docs/guides/types.md)
- [Dragging ``s](/docs/guides/dragging-svgs.md)
- How we use dom events - _Useful if you need to build on top ofreact-beautiful-dnd_
- [Adding ``s during a drag (11.x behaviour)](/docs/guides/changes-while-dragging.md) - _⚠️ Advanced_

Patterns 👷‍


- [Reparenting a ``](/docs/guides/reparenting.md) - _Using our cloning API or your own portal_

Support 👩‍⚕️



Read this in other languages 🌎


- [kr한글/Korean](https://github.com/LeeHyungGeun/react-beautiful-dnd-kr)
- [ruНа русском/Russian](https://github.com/vtereshyn/react-beautiful-dnd-ru)
- [ptPortuguês/Portuguese](https://github.com/dudestein/react-beautiful-dnd-pt)
- [grΕλληνικά/Greek](https://github.com/milvard/react-beautiful-dnd-gr)
- [ja日本語/Japanese](https://github.com/eltociear/react-beautiful-dnd-ja)

Creator ✍️


Alex Reardon @alexandereardon

Alex is no longer personally maintaning this project. The other wonderful maintainers are carrying this project forward.


Maintainers


- Many other @Atlassian's!

Collaborators 🤝


- Bogdan Chadkin @IAmTrySound