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
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add org-chart

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { OrgChart } from "@/components/ui/org-chart"; <OrgChart root={rootData} />

Source code

org-chart.tsx + 1 helper

Zero 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

PropTypeDescription
rootOrgNode[]Root nodes of the hierarchy.
expandedSet<string>Configures expanded.
onToggle(id: string) => voidCallback invoked on toggle.