reactflow
A highly customizable React library for building node-based editors and interactive flow charts
Last updated a year ago by webk1d .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install reactflow 
SYNC missed versions from official npm registry.

readme-header

GitHub License MIT npm downloads GitHub Repo stars GitHub release (latest by date)

A highly customizable React component for building interactive graphs and node-based editors.

πŸš€ Getting Started | πŸ“– Documentation | πŸ“Ί Examples | ☎️ Discord | πŸ’Ž React Flow Pro


🚨 Upcoming Changes

The main branch is the home of @xyflow/svelte and the upcoming @xyflow/react (React Flow v12). The current version is maintained and lives on the v11 branch.

Key Features

  • Easy to use: Seamless zooming and panning, single- and multi selection of graph elements and keyboard shortcuts are supported out of the box
  • Customizable: Different node and edge types and support for custom nodes with multiple handles and custom edges
  • Fast rendering: Only nodes that have changed are re-rendered
  • Hooks and Utils: Hooks for handling nodes, edges and the viewport and graph helper functions
  • Plugin Components: Background, MiniMap and Controls
  • Reliable: Written in Typescript and tested with cypress

Commercial Usage

Are you using React Flow for a personal project? Great! No sponsorship needed, you can support us by reporting any bugs you find, sending us screenshots of your projects, and starring us on Github 🌟

Are you using React Flow at your organization and making money from it? Awesome! We rely on your support to keep React Flow developed and maintained under an MIT License, just how we like it. You can do that on the React Flow Pro website or through Github Sponsors.

You can find more information in our React Flow Pro FAQs.

Installation

The easiest way to get the latest version of React Flow is to install it via npm, yarn or pnpm:

npm install reactflow

Quick Start

This is only a very basic usage example of React Flow. To see everything that is possible with the library, please refer to the website for guides, examples and the full API reference.

import { useCallback } from 'react';
import ReactFlow, {
  MiniMap,
  Controls,
  Background,
  useNodesState,
  useEdgesState,
  addEdge,
} from 'reactflow';

import 'reactflow/dist/style.css';

const initialNodes = [
  { id: '1', position: { x: 0, y: 0 }, data: { label: '1' } },
  { id: '2', position: { x: 0, y: 100 }, data: { label: '2' } },
];

const initialEdges = [{ id: 'e1-2', source: '1', target: '2' }];

function Flow() {
  const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
  const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);

  const onConnect = useCallback((params) => setEdges((eds) => addEdge(params, eds)), [setEdges]);

  return (
    <ReactFlow
      nodes={nodes}
      edges={edges}
      onNodesChange={onNodesChange}
      onEdgesChange={onEdgesChange}
      onConnect={onConnect}
    >
      <MiniMap />
      <Controls />
      <Background />
    </ReactFlow>
  );
}

Development

Before you can start developing please make sure that you have pnpm installed (npm i -g pnpm). Then install the dependencies using pnpm: pnpm install.

For local development, you can use pnpm dev.

Testing

Testing is done with cypress. You can find the tests in the examples/cypress folder. In order to run the tests do:

pnpm test

Maintainers

React Flow is developed and maintained by webkid, a web development agency with focus on data driven applications from Berlin. If you need help or want to talk to us about a collaboration, feel free to contact us:

You can also use our contact form or join the React Flow Discord Server.

Community Packages

Credits

React Flow was initially developed for datablocks, a graph-based editor for transforming, analyzing and visualizing data in the browser. Under the hood, React Flow depends on these great libraries:

  • d3-zoom - used for zoom, pan and drag interactions with the graph canvas
  • d3-drag - used for making the nodes draggable
  • zustand - internal state management

License

React Flow is MIT licensed.

Current Tags

  • 11.11.4                                ...           latest (5 months ago)
  • 11.4.0-next.1                                ...           next (2 years ago)

62 Versions

  • 11.11.4                                ...           5 months ago
  • 11.11.3                                ...           6 months ago
  • 11.11.2                                ...           7 months ago
  • 11.11.1                                ...           7 months ago
  • 11.11.0                                ...           7 months ago
  • 11.10.4                                ...           9 months ago
  • 11.10.3                                ...           10 months ago
  • 11.10.2                                ...           10 months ago
  • 11.10.1                                ...           a year ago
  • 11.10.0                                ...           a year ago
  • 11.9.4                                ...           a year ago
  • 11.9.3                                ...           a year ago
  • 11.9.2                                ...           a year ago
  • 11.9.1                                ...           a year ago
  • 11.9.0                                ...           a year ago
  • 11.8.3                                ...           a year ago
  • 11.8.2                                ...           a year ago
  • 11.8.1                                ...           a year ago
  • 11.8.0                                ...           a year ago
  • 11.7.4                                ...           a year ago
  • 11.7.3                                ...           a year ago
  • 11.7.2                                ...           a year ago
  • 11.7.1                                ...           2 years ago
  • 11.7.0                                ...           2 years ago
  • 11.6.1                                ...           2 years ago
  • 11.6.0                                ...           2 years ago
  • 11.5.6                                ...           2 years ago
  • 11.5.5                                ...           2 years ago
  • 11.5.4                                ...           2 years ago
  • 11.5.3                                ...           2 years ago
  • 11.5.2                                ...           2 years ago
  • 11.5.1                                ...           2 years ago
  • 11.5.0                                ...           2 years ago
  • 11.4.2                                ...           2 years ago
  • 11.4.1                                ...           2 years ago
  • 11.4.0                                ...           2 years ago
  • 11.4.0-next.1                                ...           2 years ago
  • 11.4.0-next.0                                ...           2 years ago
  • 11.3.3                                ...           2 years ago
  • 11.3.2                                ...           2 years ago
  • 11.3.1                                ...           2 years ago
  • 11.3.0                                ...           2 years ago
  • 11.2.0                                ...           2 years ago
  • 11.1.2                                ...           2 years ago
  • 11.1.1                                ...           2 years ago
  • 11.1.0                                ...           2 years ago
  • 11.0.0                                ...           2 years ago
  • 11.0.0-next.13                                ...           2 years ago
  • 11.0.0-next.12                                ...           2 years ago
  • 11.0.0-next.11                                ...           2 years ago
  • 11.0.0-next.10                                ...           2 years ago
  • 11.0.0-next.9                                ...           2 years ago
  • 11.0.0-next.8                                ...           2 years ago
  • 11.0.0-next.7                                ...           2 years ago
  • 11.0.0-next.6                                ...           2 years ago
  • 11.0.0-next.5                                ...           2 years ago
  • 11.0.0-next.4                                ...           2 years ago
  • 11.0.0-next.3                                ...           2 years ago
  • 11.0.0-next.2                                ...           2 years ago
  • 11.0.0-next.1                                ...           2 years ago
  • 11.0.0-next.0                                ...           2 years ago
  • 0.1.0 [deprecated]           ...           10 years ago
Maintainers (1)
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (7)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE