1.0.2 • Published 4 years ago

reactjs-treeview v1.0.2

Weekly downloads
9
License
MIT
Repository
github
Last release
4 years ago

A React tree view library

NPM JavaScript Style Guide

Install

npm install --save reactjs-treeview

Example

https://ttlong3103.github.io/react-simple-tree-view/

API

NameTypeDefaultDescription
initialDataArray[]Array of nodes to initalize tree. Each node has form:{  icon: Component  title: String | Component  childrenNode: Array  isExpanded: Boolean  isSelected: Boolean  ...yourExtraData}
indentChildNumber30Indentation of children node compares to its folder parent
selectionBackColorString#257AFDBackground color of selected node
onClickNodeFunctionCallback when click a tree node(e, { path, node }, newTree) => any- e (Object) : Event data- path (Array) : Path to node- node (Object) : Data of node- newTree (Object) : Updated tree
onExpandNodeFunctionCallback when expand a parent node by clicking expand indicator({ path, node }, newTree) => any- path (Array) : Path to node- node (Object) : Data of node- newTree (Object) : Updated tree
onCollapseNodeFunctionCallback when collapse a parent node by clicking collapse indicator({ path, node }, newTree) => any- path (Array) : Path to node- node (Object) : Data of node- newTree (Object) : Updated tree

License

MIT © ttlong3103

Development

  1. At root of repo, run npm start. This command builds code and watchs for code changes.
  2. Open another command-line, cd to folder example of this repo and run npm start. This will start browser with above built code.