sigilUI

Network Graph

Visualize a network of nodes and connections.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

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

Usage

<NetworkGraph
    nodes={[
      { id: "a", label: "Node A", x: 100, y: 100, size: 10 },
      { id: "b", label: "Node B", x: 300, y: 80 },
      { id: "c", label: "Node C", x: 200, y: 250, size: 8 },
      { id: "d", label: "Node D", x: 400, y: 200 },
    ]}
    edges={[
      { source: "a", target: "b", weight: 2 },
      { source: "a", target: "c" },
      { source: "b", target: "d", weight: 3 },
      { source: "c", target: "d" },
    ]}
  />

Props

PropTypeDefaultDescription
nodes (required)NetworkNode[]—Nodes configuration.
edges (required)NetworkEdge[]—Edges configuration.
widthnumber—Width of the rendered content.
heightnumber—Height of the rendered content.

Token integration

CSS VariablePurpose
--s-borderBorder
--s-primaryPrimary
--s-text-mutedText muted
--s-font-monoFont mono