React Sortable screenshot

React Sortable

Author Avatar Theme by Danielstocks
Updated: 3 Dec 2017
634 Stars

A sortable list component built with React

Overview

React Sortable is an intriguing higher-order component designed for creating sortable lists using only React.js and the HTML5 DragEvent interface. Its minimalist approach provides a straightforward implementation without the need for any polyfills, making it an accessible option for developers interested in drag-and-drop functionality. Despite its simplicity, React Sortable is primarily tested in the latest stable versions of Webkit, Firefox, and Internet Explorer, which speaks to its reliability across multiple browsers.

The primary appeal of React Sortable lies in its clean and efficient codebase. It takes care of most of the drag-and-drop mechanics automatically, allowing developers to focus more on the building of features rather than the intricacies of implementation. While it’s a great starting point for understanding drag-and-drop in React, it’s worth noting that there are other, more actively maintained libraries available that provide additional features and support.

Features

  • Minimalistic Implementation: Designed to be straightforward and easy to integrate without complex setups or polyfills.
  • HTML5 DragEvent Support: Leverages the native HTML5 DragEvent interface, ensuring smooth browser compatibility and performance.
  • Automatic Drag Handlers: Automatically attaches necessary drag event handlers, simplifying the setup process for developers.
  • User-defined Sort Functionality: Allows customization through properties like onSortItems, enhancing interaction with applications, particularly in Redux environments.
  • Vertical and Horizontal Support: Capable of handling both vertical and horizontal drag actions, providing flexibility in how lists are displayed and interacted with.
  • Minimal Codebase: Features fewer lines of code than alternatives, making it easier to read and modify for future updates or customizations.
  • Documentation and Testing: Comes with documented code and includes unit tests, adding a layer of reliability and ease of use for developers.
  • Inspirational Example: Serves as a showcase for what can be achieved with fundamental React components and HTML5 API.