ng-flow
June 16, 2026 · View on GitHub
A highly customizable Angular library for building node-based editors and interactive flow charts — nodes, edges, handles, pan & zoom, minimap, controls, background, selection, and more. Built the modern Angular way: standalone components, zoneless change detection, signals, input()/output(), new control flow (@if/@for), and inject().
Origin
This library is an Angular port of React Flow (@xyflow/react), part of the xyflow project by webkid GmbH. Like React Flow and Svelte Flow, ng-flow is a thin binding layer over the framework-agnostic @xyflow/system core, which it reuses directly — so edge-path math, pan/zoom, dragging, and handle/connection logic are byte-for-byte identical to React Flow.
Built with reangular
This library was generated using the reangular skill — an automated React-to-Angular conversion harness for coding agents.
Install
npm install @aleksanderbodurri/ng-flow @xyflow/system classcat zustand @angular/cdk
Import the theme once (e.g. in your global styles.scss):
@use '@aleksanderbodurri/ng-flow/styles/style.scss'; /* or the structural-only base.scss */
Quick start
import { Component, signal } from '@angular/core';
import {
NgFlow, Background, BackgroundVariant, Controls, MiniMap,
type Node, type Edge, type NodeChange, applyNodeChanges,
} from '@aleksanderbodurri/ng-flow';
@Component({
selector: 'app-flow',
imports: [NgFlow, Background, Controls, MiniMap],
template: `
<ng-flow
[nodes]="nodes()"
[edges]="edges"
[onNodesChange]="onNodesChange"
[fitView]="true"
>
<ng-flow-background [variant]="BackgroundVariant.Dots" />
<ng-flow-controls />
<ng-flow-minimap />
</ng-flow>
`,
styles: `:host { display: block; height: 100vh; }`,
})
export class FlowComponent {
protected readonly BackgroundVariant = BackgroundVariant;
protected readonly nodes = signal<Node[]>([
{ id: '1', type: 'input', data: { label: 'Node 1' }, position: { x: 250, y: 5 } },
{ id: '2', data: { label: 'Node 2' }, position: { x: 100, y: 100 } },
]);
protected readonly edges: Edge[] = [{ id: 'e1-2', source: '1', target: '2' }];
protected readonly onNodesChange = (changes: NodeChange[]) =>
this.nodes.update((ns) => applyNodeChanges(changes, ns));
}
Key differences from React Flow
- Components instead of JSX:
<ng-flow>(≈<ReactFlow>),<ng-flow-background>,<ng-flow-controls>,<ng-flow-minimap>,<ng-flow-panel>,<ng-flow-handle>,<ng-flow-node-toolbar>,<ng-flow-edge-toolbar>,<ng-flow-node-resizer>,<ng-flow-provider>(≈<ReactFlowProvider>). - Events are callback inputs named exactly as React Flow (
[onConnect],[onNodesChange],[onNodeClick],[onInit], …) so existing React Flow code migrates directly. - Hooks return Signals.
useReactFlow(),useNodes(),useViewport(),useNodesState(), etc. are called in an injection context (inside a component under<ng-flow>/<ng-flow-provider>). - Custom node/edge types are Angular component classes registered via
[nodeTypes]/[edgeTypes]and rendered with the right dynamic-component mechanism (HTML for nodes, SVG-namespaced for edges).
Demo
A demo app exercising every feature (65 routes mirroring the React Flow examples) lives in projects/demo:
npm install
npm run start # ng serve demo → http://localhost:4200
Original contributors
Contributors to React Flow / xyflow, sorted by commit count (extracted via git -C xyflow shortlog -sn --no-merges HEAD; automated bot accounts omitted):
- moklick (2527 commits)
- peterkogo (578 commits)
- Christopher Möller (142 commits)
- Moritz Klack (96 commits)
- Peter (93 commits)
- Christopher Möller (52 commits)
- Dimitri POSTOLOV (50 commits)
- Abbey Yacoe (47 commits)
- Alessandro (40 commits)
- braks (40 commits)
- Moritz (37 commits)
- Jack Fishwick (35 commits)
- Ze-Zheng Wu (15 commits)
- Eugene Samonenko (12 commits)
- Hayleigh Thompson (9 commits)
- AndyLnd (8 commits)
- Artyom Sovetnikov (8 commits)
- Ivan Akulov (8 commits)
- Nate Amack (8 commits)
- Yaroslav Halchenko (8 commits)
- Solomon Astley (7 commits)
- printer_scanner (7 commits)
- Alessandro Cheli (6 commits)
- Alireza Sheikholmolouki (6 commits)
- Clément Loridan (6 commits)
- Furkan Kalaycioglu (6 commits)
- GeoffreyLiu (6 commits)
- Peter Kogo (6 commits)
- Robin Goupil (6 commits)
- Sebastián Alvarez (6 commits)
- RunDevelopment (5 commits)
- Himself65 (4 commits)
- Joey Ballentine (4 commits)
- Karlo Bistrički (4 commits)
- ShaMan123 (4 commits)
- Wenchen Li (4 commits)
- fdnklg (4 commits)
- jasonpul (4 commits)
- Alaric Baraou (3 commits)
- Andreas Schultz (3 commits)
- Andy (3 commits)
- Coen (3 commits)
- Daniel Darabos (3 commits)
- Matt Huggins (3 commits)
- Rhys Lloyd (3 commits)
- chang_su (3 commits)
- Alexey Volkov (2 commits)
- CRIMX (2 commits)
- Christopher Hiester (2 commits)
- David Lounsbrough (2 commits)
- DiamondDrake (2 commits)
- GHOST (2 commits)
- Jakub Majorek (2 commits)
- Jeffrey Gordon (2 commits)
- John Robb (2 commits)
- Kenny Williams (2 commits)
- Long Nguyen (2 commits)
- Mahdi Esbati (2 commits)
- Noam Neeman (2 commits)
- Orlando (2 commits)
- Paula Stachova (2 commits)
- Przemysław Żydek (2 commits)
- Shlomo Galle (2 commits)
- Spencer Whitehead (2 commits)
- Veniamin Krol (2 commits)
- andreyworkspace (2 commits)
- artemtam (2 commits)
- ysds (2 commits)
- 4t145 (1 commits)
- = (1 commits)
- Abinadi Cordova (1 commits)
- Adam Krebs (1 commits)
- Aidan Barrett (1 commits)
- Akihiro Kiuchi (1 commits)
- Alex Dawes (1 commits)
- Amir Ali (1 commits)
- Amr-Shams (1 commits)
- Ashwanth Kumar (1 commits)
- Ben Chidlow (1 commits)
- Bjørn Olav Salvesen (1 commits)
- Braks (1 commits)
- Campbell Wass (1 commits)
- Christian Lagerkvist (1 commits)
- Connie (1 commits)
- Damian Stasik (1 commits)
- Daniel Leal (1 commits)
- Daniel Sanchez (1 commits)
- DenizUgur (1 commits)
- Dylan Middendorf (1 commits)
- Edson Miguel Dewes (1 commits)
- Emiel Wit (1 commits)
- Eric (1 commits)
- Fabian Bieler (1 commits)
- Fawad Shaikh (1 commits)
- Felipe Emos (1 commits)
- Ikko Eltociear Ashimine (1 commits)
- Ilia (1 commits)
- Ilya Moroz (1 commits)
- Ivan S (1 commits)
- Jaan (1 commits)
- Jakob Hofer (1 commits)
- James Moynihan (1 commits)
- Jeff Jenner (1 commits)
- Jeremiasz Major (1 commits)
- John Weis (1 commits)
- Luis Carlos (1 commits)
- Mahdi (1 commits)
- Marc Vila (1 commits)
- Michael Schmidt (1 commits)
- Michael Spiss (1 commits)
- Michael Theobald (1 commits)
- Michal Srb (1 commits)
- Miri Dagan (1 commits)
- Mustafa Kemal Tuna (1 commits)
- Nick Lawrence (1 commits)
- Niels Kaspers (1 commits)
- Philipp Garbowsky (1 commits)
- RedPhoenixQ (1 commits)
- Rein van Haaren (1 commits)
- Richard Schulz (1 commits)
- Ryan Kois (1 commits)
- Ryan Welch (1 commits)
- Sahil Mane (1 commits)
- Samuel Degueldre (1 commits)
- Serhii Holinei (1 commits)
- Stephan Eggermont (1 commits)
- Stojan Stamkov (1 commits)
- Svilen Ivanov (1 commits)
- Tiago Costa (1 commits)
- Tony Francis (1 commits)
- Tornado Softwares (1 commits)
- Totoro-moroku (1 commits)
- Tristan Brewster (1 commits)
- Tzu-Yu Lee (1 commits)
- Vincent Driessen (1 commits)
- Ward Oosterlijnck (1 commits)
- Wayne Tee (1 commits)
- clifford (1 commits)
- datoslabs (1 commits)
- dfblhmm (1 commits)
- doctoroyy (1 commits)
- dongqiang.02 (1 commits)
- fezproof (1 commits)
- filippo-one (1 commits)
- himself65 (1 commits)
- hiyangguo (1 commits)
- justn-hyeok (1 commits)
- moretall (1 commits)
- pengfu (1 commits)
- saswata (1 commits)
- spky (1 commits)
- stffabi (1 commits)
- timhwang21 (1 commits)
- timo (1 commits)
- zhbhun (1 commits)
- Émilien Leroux (1 commits)
- Ítalo Andrade (1 commits)
- Анна Кузнецова (1 commits)
- 栗嘉男 (1 commits)
License
MIT — same as the upstream xyflow project.