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

@yantrakit/flowchart-react

v2.0.1

Published

Mermaid-like, AI-first React flowchart library — author diagrams as text or object, rendered on React Flow with semantic path detection.

Readme

@yantrakit/flowchart-react

A Mermaid-like, AI-first React flowchart. Author diagrams as text (diagram-as-code) or as an object; they render on React Flow with a real interactive UI per node, automatic layout, semantic path detection, and a movie mode that plays a path node-by-node.

Docs & live demo → · GitHub

v2 is a breaking rewrite of v1. Upgrading? See MIGRATION.md. Using this from an AI agent? See AGENTS.md for the machine-facing contract.

Installation

pnpm add @yantrakit/flowchart-react
# peers: react >=18, react-dom >=18 · optional: elkjs (for the ELK layout engine)

Usage — author with text

import { FlowChart } from '@yantrakit/flowchart-react';
import '@yantrakit/flowchart-react/styles'; // required (bundles React Flow's base CSS)

<FlowChart
  height={500}
  chart={`flowchart TD
    start([Start]) --> pay{Payment OK?}
    pay -->|yes| ship[Ship order]
    pay ==>|no| fail[Show error]:::error
    ship --> done([Done])
    fail --> done`}
  onNodeClick={(id) => console.log('Clicked:', id)}
/>

React Flow is client-side — render <FlowChart> inside a client component ('use client' in the Next.js app router).

Associate a screen with each node

onNodeClick(nodeId, data) fires on every node — wire your screenshot/route off it:

<FlowChart chart={chart} onNodeClick={(id, data) => showScreenFor(id)} />

Movie mode — auto-play a path

Play a path node-by-node while the flow highlights each step; onPlaybackStep lets the other side of your screen swap to that node's UI state. Plays the selected path, or the first detected path when none is selected.

<FlowChart
  chart={chart}
  autoPlay            // start playing on mount (or use the play/pause/restart controls)
  loop
  playbackSpeedMs={1400}
  onPlaybackStep={(nodeId, index, data) => setCurrentScreen(nodeId)}
  onPlaybackEnd={() => console.log('done')}
/>

The usePlayback hook and PlaybackControls component are exported for custom playback UIs.

DSL syntax

| Syntax | Meaning | |--------|---------| | flowchart TD | header — direction TD / BT / LR / RL (required; TBTD) | | id[Label] / id{Label} / id([Label]) | action / decision / start-end node | | id:::error | explicit node type | | A --> B / A -.-> B / A ==> B | default / warning / error edge | | A -->\|label\| B | labeled edge | | A -->\|no\|:::happy B | explicit edge type override |

Key props

| Prop | Type | Default | Description | |------|------|---------|-------------| | chart / graph | string / iFlowGraph | — | Diagram source (exactly one required) | | direction | 'TD'\|'BT'\|'LR'\|'RL' | from source | Override layout direction | | layoutEngine | iLayoutEngine | dagreEngine | Pass elkEngine for ELK | | nodeTypes | iNodeRegistry | rich defaults | Replace node components per type | | activeNodeId / selectedPathId | string | — | Highlight a node / a path | | onNodeClick | (id, data) => void | — | Node click callback | | onPathChange | (id \| null) => void | — | Path selection callback | | autoPlay / loop | boolean | false | Movie mode: auto-play / loop a path | | playbackSpeedMs | number | 1200 | Movie mode: ms per node | | onPlaybackStep / onPlaybackEnd | callback | — | Movie mode: per-node / end callbacks | | showPlaybackControls / showPathDrawer / showControls / showMiniMap | boolean | true/true/true/false | Toggle UI chrome | | height | string \| number | 480 | Container height |

Also exported (pure, no React): parseFlowchart, serializeFlowchart, detectPaths, layout, dagreEngine, elkEngine, FLOW_GRAPH_SCHEMA, plus the usePaths / usePlayback hooks and PlaybackControls.

Node & edge types

  • Nodes: start · end · action · decision · error · warning · link
  • Edges: happy · warning · error · default — the edge type colors any path through it.

License

MIT © Yantrakit Inc