# retree

> A minimal, extensible and customizable tree view UI component for react.

Latest version **0.1.1** (published 2017-06-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install retree
pnpm add retree
yarn add retree
bun add retree
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2017-06-22 |
| First published | 2017-06-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Ram |
| Maintainers | vramak |
| Keywords | tree, view, react |

## Links

- npm: https://www.npmjs.com/package/retree
- Repository: https://github.com/vramakin/retree
- Homepage: https://vramakin.github.io/retree
- Issues: https://github.com/vramakin/retree/issues
- npm.io page: https://npm.io/package/retree

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2017-06-22
- 0.1.0 — 2017-06-21
- 0.0.4 — 2017-06-15
- 0.0.3 — 2017-06-14
- 0.0.2 — 2017-06-14
- 0.0.1 — 2017-06-14
- 0.0.0 — 2017-06-13

## README

# retree [![npm version](https://badge.fury.io/js/retree.svg)](https://www.npmjs.com/package/react-treeview)

A minimal, extensible and customizable tree view UI component for react.

![enter image description here](https://github.com/vramakin/retree/raw/master/sample-minimal.png)

[Demo](https://vramakin.github.io/retree)

## Installation

```sh
npm install --save retree
```


## Usage

```javascript
import React, { Component } from 'react';
import ReTree from 'retree';
import {prepareData, getChecked} from 'retree';
import '../node_modules/retree/tree-view.css';

class App extends Component {
  state = {
    data: prepareData(
    {
      label:'Pets', id:0, 
      children:[
                { label:'Cats', id:4,
                  children:[
                            {label:'Bubbles', id:5}, 
                            {label:'Riddles', id:6}
                            ]
                },
                { label:'Dogs', id:1, 
                  children:[
                            {label:'Scooby', id:2},
                            {label:'Snowy', id:3}
                            ]
                },
              ]
   }
  )
 }

  onChangeTree = (newData) => this.setState({data:newData});
  
  render() {
    return (      
      <div>
        <ReTree data={this.state.data} onChange={this.onChangeTree} ></ReTree>
        <h5>Checked Items are...</h5>
        <ol>{ Array.from(getChecked(this.state.data, new Set()))
              .map((i,k) => <li key={k}> {i.label} </li>)
            }
        </ol>
      </div>      
    );
  }
}

export default App;

```

## Development

Build: `npm install && npm run build`

Demo: `npm install && npm start`

## License

ISC.

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