Skip to content

Repository files navigation

react-ui-tree

Build StatusDependabot Statusnpmbundlephobia

React tree component

This is a fork of the library: https://github.com/pqx/react-ui-tree

Original author: https://github.com/pqx/

Demo: https://selfpub-org.github.io/react-ui-tree/

And we use styled-components for style

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

Installation

npm install @selfpub/react-ui-tree --save

Usage

<TreepaddingLeft={20}// left padding for children nodes in pixelshideRoot={true}// rendering first root tree nodetree={this.state.tree}// tree objectonChange={this.handleChange}// onChange(tree) tree object changedrenderNode={this.renderNode}// renderNode(node) return react elementrenderCaret={this.renderCaret}// renderCaret(node) return react elementrenderDragIcon={this.renderDragIcon}// renderDragIcon() return react element/>// a sample tree object// node.children, node.collapsed, node.leaf, node.nodrag properties are hardcoded{"module": "react-ui-tree","children": [{"collapsed": true,"module": "dist","children": [{"module": "node.js"}]}]}

check app.js for a working example

Development

npm install
npm start
http://localhost:8080/example

License

MIT

About

react-ui-tree component (early fork of the library: https://github.com/pqx/react-ui-tree)

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages