react-beautiful-dnd vs react-sortable-hoc vs sortablejs
Drag-and-Drop Libraries for React
react-beautiful-dndreact-sortable-hocsortablejsSimilar Packages:

Drag-and-Drop Libraries for React

Drag-and-drop libraries are essential tools in web development that facilitate the implementation of drag-and-drop interfaces. These libraries simplify the process of creating interactive and user-friendly applications by allowing users to move items around within a user interface. They provide various features such as customizable drag-and-drop behavior, accessibility support, and performance optimizations, making it easier for developers to enhance user experience and engagement in their applications.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
react-beautiful-dnd034,0321.39 MB643-Apache-2.0
react-sortable-hoc010,900-2915 years agoMIT
sortablejs031,044640 kB515a month agoMIT

Feature Comparison: react-beautiful-dnd vs react-sortable-hoc vs sortablejs

Accessibility

  • react-beautiful-dnd:

    react-beautiful-dnd is designed with accessibility in mind, providing keyboard navigation and ARIA attributes out of the box. This ensures that users who rely on assistive technologies can interact with drag-and-drop interfaces effectively, making it a great choice for applications that prioritize inclusivity.

  • react-sortable-hoc:

    react-sortable-hoc does not focus heavily on accessibility features. While it can be made accessible with additional effort, it requires more manual implementation to ensure compliance with accessibility standards, which might not be ideal for all projects.

  • sortablejs:

    sortablejs offers basic accessibility features but does not provide extensive support for ARIA roles or keyboard navigation by default. Developers may need to implement additional accessibility features themselves, making it less suitable for projects where accessibility is a primary concern.

Customization

  • react-beautiful-dnd:

    react-beautiful-dnd provides a high level of customization for drag-and-drop interactions, allowing developers to define their own drag-and-drop behavior, animations, and styles. This flexibility makes it suitable for complex use cases where specific interactions are required.

  • react-sortable-hoc:

    react-sortable-hoc is straightforward and allows for basic customization of sortable components. However, it may not offer the same level of flexibility as react-beautiful-dnd for advanced use cases, making it more suitable for simpler sortable lists.

  • sortablejs:

    sortablejs is highly customizable and can be configured to fit a wide range of use cases. It supports various options for drag-and-drop behavior, animations, and event handling, making it a versatile choice for developers looking for extensive control.

Performance

  • react-beautiful-dnd:

    react-beautiful-dnd is optimized for performance with features like virtualized lists and efficient rendering. However, its performance may be impacted in scenarios with a large number of draggable items due to its focus on accessibility and animations.

  • react-sortable-hoc:

    react-sortable-hoc is lightweight and performs well with smaller lists, but may experience performance issues with larger datasets or complex nested structures due to its reliance on React's rendering cycle.

  • sortablejs:

    sortablejs is known for its high performance and efficiency, especially with large lists. It minimizes reflows and repaints in the DOM, making it suitable for applications that require smooth drag-and-drop interactions.

Learning Curve

  • react-beautiful-dnd:

    react-beautiful-dnd has a moderate learning curve due to its rich feature set and emphasis on accessibility. Developers may need to invest time in understanding its API and best practices to fully leverage its capabilities.

  • react-sortable-hoc:

    react-sortable-hoc is relatively easy to learn and integrate into projects, making it a good choice for developers looking for a quick solution for sortable lists without extensive configuration.

  • sortablejs:

    sortablejs has a straightforward API, but its flexibility can lead to a steeper learning curve for those unfamiliar with its extensive options. Developers may need to spend time exploring its documentation to utilize its full potential.

Community and Support

  • react-beautiful-dnd:

    react-beautiful-dnd has a strong community and is actively maintained, providing good support through documentation and community resources. This makes it easier for developers to find help and examples when needed.

  • react-sortable-hoc:

    react-sortable-hoc has a smaller community compared to react-beautiful-dnd, which may result in fewer resources and examples available. However, it is still well-documented and supported by its maintainers.

  • sortablejs:

    sortablejs has a large community and extensive documentation, making it easy to find examples, tutorials, and support. Its popularity across different frameworks contributes to a wealth of resources for developers.

How to Choose: react-beautiful-dnd vs react-sortable-hoc vs sortablejs

  • react-beautiful-dnd:

    Choose react-beautiful-dnd if you need a library that emphasizes accessibility and provides a rich user experience with built-in animations. It is particularly well-suited for complex drag-and-drop interfaces where you want to manage the state of items being dragged and dropped seamlessly.

  • react-sortable-hoc:

    Choose react-sortable-hoc if you require a simple and lightweight solution for sortable lists and grids. It is easy to integrate and provides a straightforward API for managing sortable components without the overhead of additional features you may not need.

  • sortablejs:

    Choose sortablejs if you want a highly performant and flexible library that can be used with any framework, not just React. It offers extensive customization options and supports a wide range of use cases, including nested lists and drag-and-drop between different lists.

README for react-beautiful-dnd

โš ๏ธ 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

CircleCI branch npm

quote application example

Play with this example if you want!

Core characteristics

  • Beautiful and natural movement of items ๐Ÿ’
  • Accessible: powerful keyboard and screen reader support โ™ฟ๏ธ
  • Extremely performant ๐Ÿš€
  • Clean and powerful api which is simple to get started with
  • Plays extremely well with standard browser interactions
  • Unopinionated styling
  • No creation of additional wrapper dom nodes - flexbox and focus management friendly!

Get started ๐Ÿ‘ฉโ€๐Ÿซ

We have created a free course on egghead.io ๐Ÿฅš 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
  • Combining items
  • Mouse ๐Ÿญ, keyboard ๐ŸŽนโ™ฟ๏ธ and touch ๐Ÿ‘‰๐Ÿ“ฑ (mobile, tablet and so on) support
  • Multi drag 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 ๐Ÿ’–
  • Conditional dragging and conditional dropping
  • Multiple independent lists on the one page
  • Flexible item sizes - the draggable items can have different heights (vertical lists) or widths (horizontal lists)
  • Add and remove items during a drag
  • Compatible with semantic <table> reordering - table pattern
  • 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 <Draggable />
  • Create scripted drag and drop experiences ๐ŸŽฎ
  • Allows extensions to support for any input type you like ๐Ÿ•น
  • ๐ŸŒฒ Tree support through the @atlaskit/tree package
  • A <Droppable /> 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. 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

API ๐Ÿ‹๏ธโ€

diagram

Guides ๐Ÿ—บ

Patterns ๐Ÿ‘ทโ€

Support ๐Ÿ‘ฉโ€โš•๏ธ

Read this in other languages ๐ŸŒŽ

Creator โœ๏ธ

Alex Reardon @alexandereardon

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

Maintainers

Collaborators ๐Ÿค