Tree
A React tree component that looks similar to Figma tree, a tree ui component that has all the tree functionalities
Document
https://noxxxxxxxx.github.io/tree/
How to use
In an ideal scenario, we only store the necessary data in the database. When retrieving data to construct a tree, we may need to extend some attributes in the tree nodes to align with our custom logic. So we need an API fieldNames
to tell the component which nodes can be inserted into other nodes.
Confirm whether the attributes are consistent. If they are not consistent, use fieldNames
to set them.
import Tree from 'figma-tree'
import 'figma-tree/dist/style.css'
export default App () => {
const data= []
const config = {}
return (
return (
<Tree
{...config}
data={data}
/>
)
)
}
Feature
Develop
Feel free to fork or clone this repository.
pnpm i
npm run dev
LICENSE
This repository is published under MIT license