Skip to content

yieldbot/yb-react-ui-tree

 
 

Repository files navigation

yb-react-ui-tree

Forked from react-ui-tree, has changes applied from Sean's fork for removal of drag and drop.

Installation

npm install yb-react-ui-tree --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
/>

// 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

Packages

No packages published

Languages

  • JavaScript 79.4%
  • CSS 12.2%
  • HTML 6.7%
  • Makefile 1.7%