tree ui component for react
- support ie8,ie8+,chrome,firefox,safari
http://localhost:8018/examples/
online example: http://react-component.github.io/tree/examples/
var React = require('react');
var Tree = require('rc-tree');
var TreeNode = Tree.TreeNode;
React.render(
<Tree>
<TreeNode>leaf </TreeNode>
<TreeNode>leaf </TreeNode>
<Tree/>, container);
name | description | type | default |
---|---|---|---|
className | additional css class of root dom node | String | '' |
prefixCls | prefix class | String | '' |
showLine | whether show line | bool | true |
showIcon | whether show icon | bool | true |
checkable | whether support checked | bool | false |
expandAll | expand all treeNodes | bool | false |
onSelect | click the TreeNode to fire(auto switch selected state) | function | - |
onChecked | click the TreeNode's checkbox to checked(auto switch checked state) | function | - |
name | description | type | default |
---|---|---|---|
className | additional class to treeNode | String | '' |
title | tree/subTree's title | String | '---' |
defaultExpanded | whether default expand the treeNode | bool | false |
expanded | whether expand the treeNode, it's controlled | bool | false |
- KeyDown/KeyUp
npm install
npm start
http://localhost:8003/tests/runner.html?coverage
rc-tree is released under the MIT license.