JavaScript CSS HTML Makefile
Switch branches/tags
Nothing to show
Clone or download
Latest commit 38bd914 Jun 4, 2018
Permalink
Failed to load latest commit information.
example Update to React 16 Jun 1, 2018
lib fmt Jun 5, 2018
test es6 Jul 19, 2017
.babelrc update packages Sep 22, 2017
.gitignore ignore dist Sep 22, 2017
.npmignore ignore dist Sep 22, 2017
.travis.yml fix travis Sep 22, 2017
LICENSE Initial commit Apr 27, 2015
Makefile make with npm bin Dec 16, 2016
README.md update readme Nov 27, 2017
index.js make with npm bin Dec 16, 2016
package.json 4.0.0 Jun 5, 2018
webpack.config.js update packages Sep 22, 2017
yarn.lock Update to React 16 Jun 1, 2018

README.md

react-ui-tree

Build Status npm npm

React tree component

This project was initially developed for a webpage builder. It maintains an internal tree structure within the component through js-tree.

Demo

https://pqx.github.io/react-ui-tree

Installation

npm install 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