sigilUI

Tree Diagram

A hierarchical tree diagram for visualizing parent-child relationships between nodes.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { TreeDiagram } from "@sigil-ui/components";

Usage

<TreeDiagram
  root={{
    id: "root",
    label: "App",
    variant: "accent",
    children: [
      { id: "api", label: "API", children: [
        { id: "auth", label: "Auth" },
        { id: "db", label: "Database" },
      ]},
      { id: "ui", label: "Frontend" },
    ],
  }}
  connector="solid"
  compact={false}
/>

Props

PropTypeDefaultDescription
rootTreeDiagramNode—Root node of the tree hierarchy
connector"solid" | "dashed""solid"Connector line style between nodes
compactbooleanfalseUse smaller node sizing

Token integration

CSS VariablePurpose
--s-borderConnector lines and default node border
--s-surfaceNode background
--s-textNode label text
--s-text-mutedMuted variant text
--s-primaryAccent and highlighted node styling
--s-primary-mutedHighlighted node background
--s-primary-contrastAccent node text
--s-radius-mdNode border radius