# znui-react-tree

> Web tree component.

Latest version **2.0.7** (published 2021-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install znui-react-tree
pnpm add znui-react-tree
yarn add znui-react-tree
bun add znui-react-tree
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.7 |
| Published | 2021-10-08 |
| First published | 2020-03-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 112.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | yangyxu |
| Maintainers | yangyxu |
| Keywords | web component, tree |

## Links

- npm: https://www.npmjs.com/package/znui-react-tree
- Repository: https://github.com/znui/znui-react-tree
- Homepage: https://github.com/znui/znui-react-tree#readme
- Issues: https://github.com/znui/znui-react-tree/issues
- npm.io page: https://npm.io/package/znui-react-tree

## Dependencies (1)

- [znui-react](https://npm.io/package/znui-react.md) latest

## Recent versions

- 2.0.7 (latest) — 2021-10-08
- 2.0.6 — 2020-08-29
- 2.0.5 — 2020-08-28
- 2.0.4 — 2020-06-24
- 2.0.3 — 2020-04-30
- 2.0.1 — 2020-03-22
- 1.0.1 — 2020-03-05

## README

# znui-react-tree
React tree Component


[![npm](https://img.shields.io/npm/v/znui-react-tree.svg)](https://www.npmjs.com/package/znui-react-tree)
[![npm](https://img.shields.io/npm/dm/znui-react-tree.svg)](https://www.npmjs.com/package/znui-react-tree)

## Demo

[Take a look at the demo](https://znui.github.io/znui-react-tree/example/www/index.html)

## Installation

```bash
npm install znui-react-tree -s
```

## Usage

```javascript

var ReactDOM = require('react-dom');
var tree = require('znui-react-tree');

var _data = [
    {
        id: 1,
        label: 'A',
        data: [
            {
                id: 11,
                label: 'AB1',
                data: [
                    {
                        id: 111,
                        label: 'ABB1'
                    },
                    {
                        id: 112,
                        label: 'ABB2'
                    }
                ]
            },
            {
                id: 12,
                label: 'AC1',
            },
            {
                id: 13,
                label: 'AD1',
            },
            {
                id: 12,
                label: 'AC1',
            },
            {
                id: 13,
                label: 'AD1',
            },
            {
                id: 12,
                label: 'AC1',
            },
            {
                id: 13,
                label: 'AD1',
            }
        ]
    },
    {
        id: 2,
        label: 'B',
        data: [
            {
                id: 11,
                label: 'AB1',
                data: [
                    {
                        id: 111,
                        label: 'ABB1'
                    },
                    {
                        id: 112,
                        label: 'ABB2'
                    }
                ]
            },
            {
                id: 12,
                label: 'AC12',
            },
            {
                id: 13,
                label: 'AD13',
            }
        ]
    },
    {
        id: 3,
        label: 'C',
        data: [
            {
                id: 11,
                label: '3AB1',
                data: [
                    {
                        id: 111,
                        label: 'ABB1'
                    },
                    {
                        id: 112,
                        label: 'ABB2'
                    }
                ]
            },
            {
                id: 12,
                label: '3AC1',
            },
            {
                id: 13,
                label: '3AD1',
            }
        ]
    },
    {
        id: 4,
        label: 'D',
        data: [
            {
                id: 11,
                label: '4AB1',
                data: [
                    {
                        id: 111,
                        label: 'ABB1'
                    },
                    {
                        id: 112,
                        label: 'ABB2'
                    }
                ]
            },
            {
                id: 12,
                label: '4AC1',
            },
            {
                id: 13,
                label: '4AD1',
            }
        ]
    }
]
ReactDOM.render(
    <div style={{width: 1000, border: '1px solid #CCC'}}>
        <tree.Tree data={_data} onItemClick={(event, owner)=>console.log(owner)} />
        <tree.AccordionTree style={{margin: 50}} data={_data} onItemClick={(event, owner)=>console.log(owner)} />
    </div>,
    document.getElementById('container'),
);

```

## Preiview

<img src="https://znui.github.io/znui-react-tree/example/images/tree.png" />

## License

MIT

---
_Source: https://npm.io/package/znui-react-tree · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
