Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/linksplatform/react-deep-tree


https://github.com/linksplatform/react-deep-tree

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# react-deep-tree

An attempt to make traversing trees with deep-deep structure user-friendly. Started as a part of our [UI prototype](https://github.com/linksplatform/InfiniteDepthTreeWebUIPrototype).

## Install

```Shell
npm i react-deep-tree
```

## [Use](https://codesandbox.io/s/intelligent-bird-j5vit)

```JavaScript
import React from "react";
import DeepTree from "react-deep-tree";
import type { DataNode } from "react-deep-tree";

const data : DataNode[] = [
{
content: 'Text of a first level of the first element',
children: [
{
content: 'Text of a second level of the first element',
children: [],
},
{
content: 'Text of a second level of the first element',
children: [],
},
],
},
{
content: 'Text of a first level of the second element',
children: [
{
content: 'Text of a second level of the second element',
children: [],
},
{
content: 'Text of a second level of the second element',
children: [],
},
],
},
];

export default function App() {
return ;
}
```