yp-tree
v1.5.0
Published
React tree
Downloads
3
Maintainers
Readme
yp-ui-tree
React tree component
Installation
npm install yp-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": "yp-ui-tree",
"children": [{
"collapsed": true,
"module": "dist",
"children": [{
"module": "node.js"
}]
}]
}
Development
- npm install
- npm start
- http://localhost:8080/example
License
MIT