Show your files and directories like tree branches🌴
npm install @poouladorbit/treeway
yarn add @poouladorbit/treeway
To use the treeway🌴, use the following example:
import React from "react";
import Treeway from "@poouladorbit/treeway";
function Test() {
const items = [
{
name: "folder1",
type: "directory",
children: [
{
name: "file-1",
type: "file",
},
],
},
];
return (
<div>
<Treeway items={items} />
</div>
);
}
export default Test;
- items: array of objects(node data).
- backgroundColor: background color for the buttons.
- direction: direction of treeway to open subitems in left or right.
This is my first package😁. So if you find any issues or have suggestions for improvements, please open an issue or submit a pull request on GitHub.
Please follow the semantic-release package rules for commits. for more information see Semantic-Release
This project is licensed under the MIT License - see the License file for details.
- imporve style
- add checkbox(optional props)