Forked from react-ui-tree, has changes applied from Sean's fork for removal of drag and drop.
npm install yb-react-ui-tree --save
<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
- npm install
- npm start
- http://localhost:8080/example
MIT