React Flow React component library for node-based editors and interactive diagrams, with application-defined data processing.
Overview React Flow is an open-source React library for node-based editors and interactive diagrams. It supplies graph interaction features such as node dragging, selection, panning and zooming, while custom nodes can contain React components. Applications define what their graph represents and how its data should be processed or stored.[1] [4]
Contents Building a node interface Custom nodes are React components, which lets a graph include inputs, controls and domain-specific visuals. Background, minimap, toolbar and resize components help assemble the editor around them. React Flow supplies interaction primitives rather than prescribing a particular business workflow. A generated graph still needs an application-defined model for the meaning of each node and connection.[1] [4]
Computation and state The computing-flows guide shows how to update a node's data and observe connected nodes through hooks. This supports browser-side dataflow, while other applications can send data to a server for processing. The documentation warns against using node data directly as input-field UI state because delayed updates can disturb the cursor. Local input state and graph data therefore serve distinct roles. The save-and-restore example uses toObject or local node/edge state; an application's storage integration remains separate.[4] [5]
Automatic positioning is an integration React Flow's layout guide states that it does not implement its own layout solution. It presents external options including Dagre, D3-based layouts and ELK, with different capabilities and complexity. The guide notes a Dagre limitation for sub-flows connected outside their group and distinguishes node layout from edge routing. Choosing a node-editor library does not by itself settle automatic graph placement or routing requirements.[2]
Server-rendered diagrams Server-side rendering has been supported since React Flow 12, but requires geometry that the server cannot measure from the DOM. Node width and height, or initial dimensions for later client measurement, must be supplied. Rendering edges also requires handle positions. This can support static documentation diagrams and generated images; it is not evidence that an unconfigured client graph will render correctly on the server.[3]
Version and packaging The v12 migration changes the package name from reactflow to @xyflow/react, uses a named ReactFlow import and changes stylesheet paths. Earlier multi-package examples need reconciliation with the consolidated package. These are practical checks for AI-generated code, where mixing old imports with current APIs can leave an otherwise plausible component incorrectly configured.[6]
Open-source and Pro scope The core is MIT-licensed, with notice retention required for redistribution. Pro is an optional subscription offering examples, templates and support while the underlying library remains open source. Access to paid examples should not be assumed merely from installing the MIT package. This article makes no claim about having accessed or tested Pro materials.[7] [8]
Substitution considerations React Flow can substitute for the visual editor portion of Rete.js in a React application when its component model and application-defined computation are suitable. Rete emphasizes processing-oriented editors and offers dedicated engine modules. Moving between them means redesigning node components, data and processing integration; the shared diagram metaphor does not establish saved-graph compatibility. This assessment is based on documentation rather than a migration test.[1] [4] [9]
Also included: 4 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.