React Tree Menu Component
A stateless tree component with the following features:
Checkboxes
Collapsible nodes
Dynamic tree generation
Declarative tree menus
Built with the Flux proposal in mind (i.e. trickle-down state)
Please check out the Demo.
Install
npm install --save react-tree-menu
General Usage
var TreeMenu = require('react-tree-menu').TreeMenu,
TreeNode = require('react-tree-menu').TreeNode;
...
Exports
This package exports the following:
module.exports = {
TreeMenu: require('./src/TreeMenu.jsx'),
TreeNode: require('./src/TreeNode.jsx'),
Utils: require('./src/TreeMenuUtils')
};
Declarative use
In your .render() method, embed TreeMenu:
return
identifier={"id"}
onTreeNodeClick={this._setLastActionState.bind(this, "clicked")}
onTreeNodeCheckChange={this._setLastActionState.bind(this, "checked")}
collapsible={false}
expandIconClass="fa fa-chevron-right"
collapseIconClass="fa fa-chevron-down">
;Dynamic use w/ the 'data' prop
In your .render() method, embed TreeMenu with a data prop:</