百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-organizational-chart

> 前端框架
开源

简单的 React 层次结构树 - 任何接受节点的 React 子元素

194 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

简单的 React 层次结构树 - 任何接受节点的 React 子元素

react-organizational-chart

Simple react hierarchy tree - any React children accepted for nodes

Install

bash
npm install --save react-organizational-chart

Usage

javascript
import React from 'react';
import { Tree, TreeNode } from 'react-organizational-chart';

const ExampleTree = () => (
  
    
      
    
  
);

Examples

Styled tree

javascript
const StyledNode = styled.div`
  padding: 5px;
  border-radius: 8px;
  display: inline-block;
  border: 1px solid red;
`;

const StyledTreeExample = () => (
  Root}
  >
    Child 1}>
      Grand Child} />
    
    Child 2}>
      Grand Child}>
        Great Grand Child 1} />
        Great Grand Child 2} />
      
    
    Child 3}>
      Grand Child 1} />
      Grand Child 2} />
    
  
);

Interactive examples can be found here

Components

Tree - The root of the tree

Accepts the following props:

  • label: (required) Any react Node
  • children: (required) Any number of ``
  • lineHeight: (default 20px) The height of the Path as a css length
  • lineWidth: (default 1px) The width of the Path as a css length
  • lineColor: (default black) The color of the Path as a css color
  • lineStyle: (default solid) The line style as a css line-style
  • lineBorderRadius: (default 5px) The border radius of the Path as a css border-radius
  • nodePadding: (default 5px) The left and right padding of every `` as a css length

TreeNode - A node in the tree

  • label: (required) Any react Node
  • children: (required) Any number of ``

Motivation

I created react-organizational-chart because i could not find any other react organizational chart that supports react components as nodes.

Alternatives

  • org-chart is highly customizable but can't render React components as nodes.

License

MIT © daniel-hauser

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptchartorg-chartreacttree

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架