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

@graph-render/react

v1.4.0

Published

[![npm](https://img.shields.io/npm/v/@graph-render/react.svg)](https://www.npmjs.com/package/@graph-render/react) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/oleksandr-zhynzher/graph-render/blob/main/LICENSE) [!

Downloads

485

Readme

@graph-render/react

npm License: MIT React TypeScript

Interactive graph canvas for React.

Render dependency graphs, DAGs, trees, and any custom graph with pan, zoom, selection, search, and your own React node components.

Install

yarn add @graph-render/react react react-dom

Quick Start

import { Graph } from '@graph-render/react';
import { EdgeType, LayoutType } from '@graph-render/types';

const graph = {
  nodes: {
    api: { label: 'API' },
    db: { label: 'Database' },
    cache: { label: 'Cache' },
  },
  adj: {
    api: {
      db: { id: 'api-db', type: 'directed' },
      cache: { id: 'api-cache', type: 'directed' },
    },
    db: {},
    cache: {},
  },
};

export default function App() {
  return (
    <Graph
      graph={graph}
      config={{
        layout: LayoutType.Tree,
        defaultEdgeType: EdgeType.Directed,
        width: 900,
        height: 520,
      }}
    />
  );
}

Custom Nodes

Pass any React component as vertexComponent to render your own node UI:

import type { VertexComponentProps } from '@graph-render/types';

function ServiceNode({ node }: VertexComponentProps) {
  return (
    <foreignObject width={node.size?.width ?? 160} height={node.size?.height ?? 64}>
      <div
        style={{
          width: '100%',
          height: '100%',
          display: 'grid',
          placeItems: 'center',
          borderRadius: 10,
          background: '#0f172a',
          color: '#e2e8f0',
          fontWeight: 600,
        }}
      >
        {node.label}
      </div>
    </foreignObject>
  );
}

<Graph graph={graph} vertexComponent={ServiceNode} />;

Features

  • Tree, DAG, grid, radial, centered, force-directed, compact bracket, and orthogonal flow layouts
  • Pan, zoom, fit view, and translate bounds
  • Node and edge selection
  • Search with match highlighting and unmatched-node hiding
  • Hover callbacks for nodes and edges
  • Collapsible subtrees
  • Custom React node components
  • Viewport control via imperative ref handle
  • SVG export support through @graph-render/core
  • React 19 required

Layout Options

import { LayoutType, LayoutDirection } from '@graph-render/types';

// LayoutType.Tree           — hierarchical tree
// LayoutType.Dag            — layered DAG
// LayoutType.Grid           — uniform grid
// LayoutType.Radial         — radial tree
// LayoutType.Centered       — centered hub
// LayoutType.ForceDirected  — physics simulation
// LayoutType.CompactBracket — tight tournament bracket
// LayoutType.OrthogonalFlow — top-down flow diagram

// LayoutDirection.LTR — left to right
// LayoutDirection.RTL — right to left

License

MIT — free for personal and commercial use. See LICENSE.