• Stars
    star
    19,329
  • Rank 1,252 (Top 0.03 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

React Flow | Svelte Flow - Powerful open source libraries for building node-based UIs with React (https://reactflow.dev) or Svelte (https://svelteflow.dev). Ready out-of-the-box and infinitely customizable.

readme-header-dark 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


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 and only those in the viewport are displayed
  • 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

Quickstart

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>
  );
}

export default Flow;

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.

Run pnpm build once and then you can use pnpm dev for local development.

Testing

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

pnpm test

Maintainers

React Flow is the full-time project of Moritz and Christopher of webkid, based in Berlin. If you need help or want to talk to us about a collaboration, reach out through our contact form or by joining the React Flow Discord Server.

Any support you provide goes directly towards the development and maintenance of React Flow, allowing us to continue to operate as an independent company, working on what we think is best for React Flow as an open-source library.

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.

More Repositories

1

awesome-d3

A list of D3 libraries, plugins and utilities
5,066
star
2

webpack-starter

✨ A lightweight foundation for your next webpack based frontend project.
JavaScript
1,924
star
3

awesome-node-based-uis

A curated list with resources about node-based UIs
1,897
star
4

awesome-interactive-journalism

A list of awesome interactive journalism projects.
1,827
star
5

react-starterkit

Yet another react starterkit. Including react-router, reflux, jest, webpack, gulp and stylus.
JavaScript
349
star
6

d3-extended

Extends D3 with some common jQuery functions and more
JavaScript
274
star
7

riotjs-startkit

A Riot - PostCSS - Webpack Starterkit
JavaScript
132
star
8

react-starter

🚀 A minimal react boilerplate featuring easy-peasy state management and styled-components
JavaScript
110
star
9

react-flow-example-apps

Example React Flow apps for Create React App, Next.js and Remix.
TypeScript
101
star
10

ghost-wbkd

A ghost/journey theme.
CSS
100
star
11

making-maps-with-react

🌐 Example React components for React-Leaflet, Pigeon Maps, React MapGL and more
JavaScript
74
star
12

leaflet-swoopy

⤵️ Swoopy Arrow Plugin for Leaflet
JavaScript
70
star
13

react-flow-mindmap-app

A quick and organized mind map app built with React Flow. Follow the tutorial to learn how to build it yourself.
TypeScript
66
star
14

d3-discovery

A tool for exploring D3.js plugins
Vue
50
star
15

pro-platform

✨ The subscriber platform for React Flow Pro. View advanced code examples, invite your team members and manage your subscription.
TypeScript
49
star
16

leaflet-truesize

Leaflet plugin for easily comparing sizes of geographical shapes
JavaScript
48
star
17

hapi-rest-starter-simple

A simple Hapi project that offers you a REST API based on Dogwater and Bedwetter.
JavaScript
43
star
18

react-flow-docs

⚠️ This repo contains old versions of the React Flow website. The new repo is located at:
JavaScript
42
star
19

dsv-loader

A webpack module to load dsv (e.g. .csv or .tsv) files.
JavaScript
35
star
20

from-data-to-sound

🎵 Simple Node.js script for transforming data to a MIDI file
JavaScript
33
star
21

react-flow-docs-v9

Archived documentation of React Flow version 9. Powered by Gatsby.
JavaScript
31
star
22

frontend-starterkit

Starting point for web apps. It provides a prepared development environment based on gulp, stylus and webpack.
JavaScript
19
star
23

dashboard-prototyper

React Dashboard helps you to generate dashboard prototypes very quickly with "configuration over code".
JavaScript
17
star
24

react-flow-web-audio

A simple Web Audio playground built with React Flow. Follow the tutorial to learn how to build it yourself.
JavaScript
16
star
25

web

📖 This monorepo contains the xyflow website and the documentation sites for React Flow and Svelte Flow.
MDX
15
star
26

leaflet-mapshot

🌍 A simple script for taking automated screenshots from a Leaflet map
JavaScript
14
star
27

bpa-wochenberichte-htw

Python
12
star
28

wordcount-api

API to count unique words in german and english texts
Python
10
star
29

wordcounter

Small tool to count words in a text.
JavaScript
8
star
30

geocoder

A small utility script for geocoding addresses in a csv file
JavaScript
8
star
31

ddj-catalogue

DDJ-Katalog Frontend
JavaScript
8
star
32

vite-react-flow-template

A vite template to get started with React Flow
TypeScript
8
star
33

awesomer

Turn your awesome list into an HTTP API
JavaScript
7
star
34

mfund_traffic-notebook

A Jupyter Notebook for visualizing traffic data.
Jupyter Notebook
7
star
35

nginx-nvm-mongo

Packer template to create nginx-nvm-mongo stack images using Ansible provisioning
Shell
7
star
36

tresor

A tool that enables you to use Trello as a headless CMS
JavaScript
6
star
37

react-isomorphic-example

An example for isomorphic apps using React and Express.
JavaScript
6
star
38

germany-iconfont

An iconfont of the german states.
CSS
5
star
39

berlin-iconfont

An iconfont for Berlin.
CSS
4
star
40

piwik-dashboard

A frontend that displays data from the Piwik API.
JavaScript
4
star
41

vite-svelte-flow-template

A vite template to get started with Svelte Flow
Svelte
3
star
42

react-flow-hero-exploration

A place to explore different flows to use in the hero of our redesign.
JavaScript
1
star
43

ddj-catalogue-backend

Contains the API for the ddj-catalogue and the spreadsheet importer
JavaScript
1
star
44

reactflow-webpack4

Example React Flow + webpack 4.
JavaScript
1
star