A React component that displays nested tree data with drag-and-drop reordering, collapse, search, and optional virtualization. Maintainers note it is not actively maintained.
Overview
React Sortable Tree is a React UI component for showing hierarchical data as an interactive tree. Users can drag nodes to reorder them, expand or collapse branches, and search titles or subtitles with optional focus and scroll-to-match behavior.
You supply treeData and an onChange callback so your app owns updates, similar to controlled React inputs. Optional hooks cover moves, visibility toggles, drag state, max depth, RTL row direction, and rules for which nodes may drag or drop. Packaged themes can swap the default look, including file-explorer and minimal styles.
Helper utilities convert flat records to nested trees and back, and support add, remove, map, walk, and search operations on tree structures. Virtualization is enabled by default for large lists; disabling it turns off some auto-scroll behaviors during drag and search focus.
The component builds on react-dnd. A variant without its own drag context exists for apps that already use react-dnd elsewhere. Storybook demonstrates basic and advanced usage. Browser compatibility is documented for Chrome, Firefox, Safari, and IE 11.
Key features
- Drag-and-drop tree reordering
- Expandable nested node data
- Built-in search with highlighting
- Optional row virtualization
- Flat-to-tree data helper utilities
- Packaged visual themes
- Configurable drag and drop rules
- Context-free variant for react-dnd
Use cases
- File or folder explorers in web apps
- Nested category or menu editors
- Org charts and taxonomy browsers
- Sortable outline or hierarchy UIs