/react-treeview

An implement of treeview component with react.js

Primary LanguageJavaScriptMIT LicenseMIT

react-treeview

An implement of treeview component with react.js

Screenshot

snapshot

  • support ie8+,chrome,firefox,safari

Example

http://localhost:8008/examples/

Usage

import Tree from './treeview';
import TreeNode from './treenode';
React.render(
  <Tree autoCheckNodes={true}>
    <TreeNode text="Movies">
      <TreeNode text="The Shawshank Redemption"/>
      <TreeNode text="The Godfather" />
      <TreeNode text="The Dark Knight" />
    </TreeNode>
  </Tree>,
  document.querySelector('body'));

API

props

name type default description
enableTriState bool Enable triple-state of checkboxes
autoCheckNodes bool whether expand the tree node
showCheckboxes bool Determines if checkbox shown on node
expandState bool true Set default expand state of each node.
nodeExpanded function Fired when node expanded
nodeCollapsed function Fired when node collapsed
nodeChecked function Fired when node checked

License

react-treeview is released under the MIT license.