# @pxp-ui/tree

> Tree react component

Latest version **0.0.1** (published 2021-10-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install @pxp-ui/tree
pnpm add @pxp-ui/tree
yarn add @pxp-ui/tree
bun add @pxp-ui/tree
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2021-10-29 |
| First published | 2021-10-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12.x |
| Dependencies | 5 |
| Unpacked size | 25.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Israel CM |
| Maintainers | imamani, kplian-info |
| Keywords | pxp, react |

## Links

- npm: https://www.npmjs.com/package/@pxp-ui/tree
- Repository: https://github.com/kplian/tree-react-component
- Homepage: https://github.com/kplian/tree-react-component#readme
- Issues: https://github.com/kplian/tree-react-component/issues
- npm.io page: https://npm.io/package/@pxp-ui/tree

## Dependencies (5)

- [@mui/lab](https://npm.io/package/@mui/lab.md) ^5.0.0-alpha.51
- [@mui/material](https://npm.io/package/@mui/material.md) ^5.0.4
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.5.0
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) ^11.3.0
- [@mui/icons-material](https://npm.io/package/@mui/icons-material.md) ^5.0.4

## 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.0.1 (latest) — 2021-10-29

## README

# React Tree Component
Tree component designed for @pxp-ui

## Installation
```
$ npm install @pxp-ui/tree
```

## Basic Usage
```typescript
import React, { useState } from 'react';
import Tree from '@pxp-ui/tree';

const App = () => {
  const [data, setData] = useState([{
        id: '1',
        label: 'Parent',
        children: [{
          id: '2',
          label: 'Child 1',
        }]
  }]);

  return(
    <TreeMui 
      data={data}
      onSelectedNodes={console.log}
      enableChecked
    />
  )
}

export default App;
```

## Props
Name | Type | Default | Description |
------------ | ------------- | ------------- | ------------- |
enableChecked | boolean | true | Show a checkbox, which allow select the tree item. |
data | Array<ILeaf> | [] | Initial tree data |
options | Array<IOption> | | Options events for custom menu. |
render | node | | The custom content of the tree item. |
onLoadChildren | function | | Callback fired when the tree item is selected the first time.  |
onSelectedNodes | function | | Callback fired when tree items are selected/unselected. |

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