react-ui-sortable-tree-drag

2.6.16 • Public • Published

react-ui-sortable-tree Build Status

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

<Tree
  paddingLeft={20}               // left padding for children nodes in pixels
  tree={this.state.tree}         // tree object
  onChange={this.handleChange}   // onChange(tree) tree object changed
  renderNode={this.renderNode}   // renderNode(node) return react element
  canMoveNode={this.canMoveNode} // canMoveNode(from, to, placement, parent) return bool
  canDrag={this.canDrag}         //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

License

MIT

Package Sidebar

Install

npm i react-ui-sortable-tree-drag

Weekly Downloads

2

Version

2.6.16

License

MIT

Unpacked Size

52.7 kB

Total Files

22

Last publish

Collaborators

  • sayitodeng