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.
Installations
npm install @xyflow/react
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Node Version
20.18.1
NPM Version
10.8.2
Score
87.2
Supply Chain
93.4
Quality
93.4
Maintenance
100
Vulnerability
100
License
Releases
@xyflow/svelte@0.1.26
Published on 18 Dec 2024
@xyflow/system@0.0.47
Published on 09 Dec 2024
@xyflow/svelte@0.1.25
Published on 09 Dec 2024
@xyflow/react@12.3.6
Published on 09 Dec 2024
@xyflow/react@12.3.5
Published on 11 Nov 2024
@xyflow/system@0.0.46
Published on 11 Nov 2024
Contributors
Languages
TypeScript (83.16%)
Svelte (13.62%)
CSS (2.61%)
JavaScript (0.61%)
Developer
Download Statistics
Total Downloads
3,723,773
Last Day
12,365
Last Week
201,912
Last Month
1,299,261
Last Year
3,723,773
GitHub Statistics
26,594 Stars
4,956 Commits
1,724 Forks
119 Watching
39 Branches
93 Contributors
Bundle Size
174.81 kB
Minified
54.34 kB
Minified + Gzipped
Package Meta Information
Latest Version
12.3.6
Package Id
@xyflow/react@12.3.6
Unpacked Size
934.39 kB
Size
194.66 kB
File Count
484
NPM Version
10.8.2
Node Version
20.18.1
Publised On
09 Dec 2024
Total Downloads
Cumulative downloads
Total Downloads
3,723,773
Last day
-83.4%
12,365
Compared to previous day
Last week
-44%
201,912
Compared to previous week
Last month
27.8%
1,299,261
Compared to previous month
Last year
0%
3,723,773
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
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
- 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:
1npm install @xyflow/react
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.
1import { useCallback } from 'react'; 2import { 3 ReactFlow, 4 MiniMap, 5 Controls, 6 Background, 7 useNodesState, 8 useEdgesState, 9 addEdge, 10} from '@xyflow/react'; 11 12import '@xyflow/react/dist/style.css'; 13 14const initialNodes = [ 15 { id: '1', position: { x: 0, y: 0 }, data: { label: '1' } }, 16 { id: '2', position: { x: 0, y: 100 }, data: { label: '2' } }, 17]; 18 19const initialEdges = [{ id: 'e1-2', source: '1', target: '2' }]; 20 21function Flow() { 22 const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes); 23 const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges); 24 25 const onConnect = useCallback((params) => setEdges((eds) => addEdge(params, eds)), [setEdges]); 26 27 return ( 28 <ReactFlow 29 nodes={nodes} 30 edges={edges} 31 onNodesChange={onNodesChange} 32 onEdgesChange={onEdgesChange} 33 onConnect={onConnect} 34 > 35 <MiniMap /> 36 <Controls /> 37 <Background /> 38 </ReactFlow> 39 ); 40} 41 42export 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:
1pnpm test
xyflow Team
React Flow is maintained by the team behind xyflow. If you need help or want to talk to us about a collaboration, reach out through our contact form or by joining our Discord Server.
- Christopher • Twitter • Github
- Hayleigh • Twitter • Github
- John • Website • Mastodon
- Moritz • Twitter • Github
- Peter • Github
Any support you provide goes directly towards the development and maintenance of React Flow and Svelte Flow, allowing us to continue to operate as an independent company, working on what we think is best for our open-source libraries.
Community Packages
- useUndoable - Hook for undo/redo functionality with an explicit React Flow example
- react-flow-smart-edge - Custom edge that doesn't intersect with nodes
- Feliz.ReactFlow - Feliz React Bindings for React Flow
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.
No vulnerabilities found.
No security vulnerabilities found.