Skip to content

pooulad/treeway

Repository files navigation

treeway🌴

Show your files and directories like tree branches🌴

install with npm

npm install @poouladorbit/treeway

install with yarn

yarn add @poouladorbit/treeway

Usage

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;

treeway_props_image

props

  • items: array of objects(node data).
  • backgroundColor: background color for the buttons.
  • direction: direction of treeway to open subitems in left or right.

sample image of the project

treeway_preview_image

Contributing

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

License

This project is licensed under the MIT License - see the License file for details.

Todo

  • imporve style
  • add checkbox(optional props)