npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ii_elif_ii/react-node-tree

v1.0.8

Published

Animated React node tree component with configurable layouts and connection lines.

Readme

@ii_elif_ii/react-node-tree

Animated React tree renderer with configurable layout and SVG connection lines.

Install

npm install @ii_elif_ii/react-node-tree

Peer dependencies:

  • react
  • react-dom

Quick Start

import * as React from "react";
import { NodeTree, type TreeNode } from "@ii_elif_ii/react-node-tree";
import "@ii_elif_ii/react-node-tree/styles.css";

const tree: TreeNode[] = [
  {
    id: "root",
    render: ({ node }) => <div className="rounded border p-3">{node.id}</div>,
    children: {
      layout: "row",
      nodes: [
        { id: "child-1", render: ({ node }) => <div>{node.id}</div> },
        { id: "child-2", render: ({ node }) => <div>{node.id}</div> },
      ],
    },
  },
];

export function Demo() {
  return (
    <NodeTree
      nodeTree={tree}
      layout={{ direction: "down", root: "stack", gap: 64 }}
      connection={{ color: "rgba(255,255,255)", width: 1, opacity: 0.15 }}
      animation={{ durationMs: 2000 }}
      className={{ frame: "my-node-frame" }}
      nodeFrame={{ style: { borderRadius: 12 } }}
    />
  );
}

Terminology

  • NodeTree: the React component that renders the full tree.
  • TreeNode: the node data model used to build your tree.

API

TreeNode<TData = unknown>

type TreeNode<TData = unknown> = {
  id: string;
  data?: TData;
  render: (context: TreeNodeRenderContext<TData>) => React.ReactNode;
  children?: {
    layout?: "stack" | "row";
    nodes: TreeNode<TData>[];
  };
};

TreeNodeRenderContext<TData = unknown>

  • node: current TreeNode
  • index: index among siblings
  • depth: depth from root (0 for root)
  • parentId: parent id (undefined for root nodes)
  • path: ancestor path ending with current node id
  • isLeaf: whether the node has no children
  • childCount: number of direct children
  • isNodeAnimationDone: whether this node's enter animation finished

NodeTreeProps

  • nodeTree: TreeNode[] root nodes to render
  • className?: NodeTreeClassNameOptions slot classes (root, canvas, renderer, frame, connections)
  • layout?: NodeTreeLayoutOptions
  • connection?: NodeTreeConnectionOptions
  • animation?: NodeTreeAnimationOptions
  • nodeFrame?: NodeTreeFrameOptions
  • debug?: boolean
  • all standard div attributes except plain className (this package uses slot-based className)

NodeTreeLayoutOptions

  • align?: "center" | "start" | "end" | { x, y }
  • direction?: "down" | "right"
  • root?: "stack" | "row"
  • gap?: number
  • padding?: number
  • containerPadding?: number

NodeTreeConnectionOptions

  • color?: string
  • width?: number
  • opacity?: number

NodeTreeAnimationOptions

  • durationMs?: number

NodeTreeFrameOptions

  • style?: React.CSSProperties

Exports

Component

  • NodeTree

Types

  • TreeNode
  • TreeNodeChildren
  • TreeNodeRenderContext
  • TreeNodeEdge
  • NodeTreeProps
  • NodeTreeLayoutOptions
  • NodeTreeConnectionOptions
  • NodeTreeAnimationOptions
  • NodeTreeClassNameOptions
  • NodeTreeFrameOptions
  • NodeFrameProps