react-deep-tree

0.0.6 • Public • Published

react-deep-tree

An attempt to make traversing trees with deep-deep structure user-friendly. Started as a part of our UI prototype.

Install

npm i react-deep-tree
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 <DeepTree data={data} />;
}

/react-deep-tree/

    Package Sidebar

    Install

    npm i react-deep-tree

    Weekly Downloads

    0

    Version

    0.0.6

    License

    LGPL-3.0

    Unpacked Size

    610 kB

    Total Files

    27

    Last publish

    Collaborators

    • konard