Skip to content
nexubDesign System
v11.9.0

Components · Data Display

Org Chart

AlphaAdded v11.5.0

People top-down as cards joined by lines, keyboard navigable as a tree. A TreeView on narrow screens.

import { OrgChart } from '@nexub/react';
View as Markdown

Usage

Use it for
  • Reporting lines: a company, a team, a studio.

  • Any small hierarchy people scan by face or name.

Use something else for
  • Deep or wide data people search or check: use TreeView.

  • Free-form graphs and workflows: use DiagramCanvas.

Examples

Default

  • Ada LovelaceChief Executive
    • Alan TuringEngineering
      • Grace HopperPlatform lead
      • Margaret HamiltonFlight software
    • Katherine JohnsonResearch

Opened: nobody yet

Custom cards, controlled

  • Studio24 people
    • Design8 people
    • Ops4 people

Props

Props
PropTypeDefaultDescription
nodesrequiredOrgChartNode[]—The TreeView node shape plus description (the role line) and avatar (photo URL; initials without one).
aria-labelstring—Names the tree.
aria-labelledbystring—Names the tree.
expandedstring[]—Open node ids. Shared with the narrow-screen TreeView.
defaultExpandedstring[]—Open node ids. Shared with the narrow-screen TreeView.
onExpandedChange((ids: string[]) => void)—Open node ids. Shared with the narrow-screen TreeView.
onActivate((node: OrgChartNode) => void)—Click or Enter on a card, e.g. to open the profile.
renderCard((node: OrgChartNode) => React.ReactNode)—Replaces the card content; it also names the item. The reports control stays.
classNamestring—On the scroll box. Wide charts scroll sideways inside it.

Accessibility

ARIA roles

treetreeitem with aria-level, aria-setsize, aria-posinset, aria-expandedgroup

Keyboard

  • ArrowDown / ArrowUp

    Next or previous visible card in tree order (depth first), as in TreeView, not by position on screen.

  • ArrowRight

    Opens a closed card, or moves to its first report. Mirrored in RTL.

  • ArrowLeft

    Closes an open card, or moves to its manager. Mirrored in RTL.

  • Home / End

    First or last visible card.

  • Enter

    Calls `onActivate`.

  • Space

    Opens or closes the card’s reports.

Focus

  • The chart is one tab stop (roving tabindex); focus scrolls the card into view.

Notes

  • Each item is named by its name and role only, not by its reports.

  • The "3 reports" control is a pointer shortcut; keyboard and screen readers use the item’s expanded state.

  • Below 768px the same nodes render as a TreeView (photo, name and role on one row).

  • Connectors are CSS borders on logical sides, so RTL mirrors and forced colours keep them.

On iOS & Android