react-ui-sortable-tree
React tree component
Forked from https://github.com/ukrbublik/react-ui-sortable-tree.
add canDrap to control drap tree (see prop canDrap
).
This project was initially developed for a webpage builder. It maintains an internal tree structure within the component through js-tree.
Installation
npm install react-ui-sortable-tree-drag --save
Usage
<TreepaddingLeft=20 // left padding for children nodes in pixelstree=thisstatetree // tree objectonChange=thishandleChange // onChange(tree) tree object changedrenderNode=thisrenderNode // renderNode(node) return react elementcanMoveNode=thiscanMoveNode // canMoveNode(from, to, placement, parent) return boolcanDrag=thiscanDrag //canDrag() return bool/>// a sample tree object// node.children, node.collapsed, node.leaf properties are hardcoded"module": "react-ui-tree""children":"collapsed": true"module": "dist""children":"module": "node.js"
check app.js for a working example
Development
- npm install
- npm start
- http://localhost:8888/example
License
MIT