Componentcharts1.1 KB gzipZero dependencies
Org Chart
Hierarchical tree of boxes with connector lines, expand/collapse nodes, avatar initials, and entrance animations.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add org-chartOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { OrgChart } from "@/components/ui/org-chart"; <OrgChart root={rootData} />Source code
org-chart.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxorg-chart.tsx127 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface OrgNode { id: string; label: string; role?: string; children?: OrgNode[];} export interface OrgChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onToggle"> { root?: OrgNode[]; expanded?: Set<string>; onToggle?: (id: string) => void;} Props
| Prop | Type | Description |
|---|---|---|
| root | OrgNode[] | Root nodes of the hierarchy. |
| expanded | Set<string> | Configures expanded. |
| onToggle | (id: string) => void | Callback invoked on toggle. |