Back to gallery
xyflow/xyflow on GitHub — React Flow | Svelte Flow | Vue Flow - Powerful open source libraries for building node-based UIs with React (https://reactflow.dev), Svelte (https://svelteflow.dev) and Vue (https://vueflow.dev). Ready out-of-the-box and infinitely customizable.
xyflow
Built byxyflow/

xyflow

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

Stars
39.1k
Forks
2.6k
Watchers
39.1k
Open issues
134
TypeScriptMIT main Updated 21 hours ago~15 stars/day lifetime
Editor's take

xyflow is the monorepo behind React Flow, Svelte Flow and now Vue Flow, libraries for node-based UIs such as workflow builders, diagram editors and visual programming tools. Vue Flow now lives in the same monorepo, and all three adapters shipped releases on November 23. You get panning, zooming, custom nodes and edges and a large example set. The tradeoff: the canvas shows a small attribution link, and the maintainers ask you to subscribe if you remove it; that is a support request, not a license term, since it is MIT. Large graphs with heavy custom nodes still need performance work. About 39k stars.

Use this if

You are building a workflow builder, agent graph editor or diagram tool in React, Svelte or Vue.

Skip if

You only need static flowcharts; a Mermaid renderer is much lighter than an interactive canvas.

UI ComponentsCharts & Viz
Topics
flowchartgraphjavascriptnode-based-uireactreact-flowsveltesvelte-flowtypescripttypescript-libraryvuevue-flowworkflow
Quick install
# Install via npm / pnpm / bun:
pnpm add xyflow
# or
npm install xyflow

Inferred from TypeScript · always double-check against the official README below.

README — rendered from xyflow/xyflow
xyflow: React Flow, Svelte Flow and Vue Flow

GitHub License MIT npm downloads npm downloads

Powerful open source libraries for building node-based UIs with React, Svelte and Vue. Ready out-of-the-box and infinitely customizable.

React Flow · Svelte Flow · Vue Flow · React Flow Pro · Discord


The xyflow mono repo

The xyflow repository is the home of several packages:

Attribution and support

React Flow, Svelte Flow and Vue Flow show a small attribution link in the corner of the canvas. If you remove it, we ask you to subscribe – no matter if you are building a side project, an internal tool or a commercial product. Subscriptions are how we keep our libraries developed and maintained under an MIT license, just how we like it.

This is a support expectation, not a legal requirement: the MIT license does not require you to pay or to keep the attribution. If you keep it, you can still support us by reporting bugs, building something for the ecosystem, starring us on GitHub 🌟 or sponsoring us via GitHub Sponsors.

Getting started

The best way to get started is to check out the React Flow, Svelte Flow or Vue Flow learn section. However if you want to get a sneak peek of how to install and use the libraries you can see it here:

React Flow basic usage

Installation

npm install @xyflow/react

Basic usage

import { useCallback, useState } from 'react';
import {
ReactFlow,
MiniMap,
Controls,
Background,
useNodesState,
useEdgesState,
addEdge
} from '@xyflow/react';

import '@xyflow/react/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] = useState(initialNodes);
const [edges, setEdges] = useState(initialEdges);

const onConnect= useCallback((params) => setEdges((eds) => addEdge(params, eds)), [setEdges]);
const onNodesChange = useCallback((changes) => setNodes(nds => changes.applyTo(nds)));
const onEdgesChange= useCallback((changes) => setEdges(eds => changes.applyTo(eds)));

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

export default Flow;
Svelte Flow basic usage

Installation

npm install @xyflow/svelte

Basic usage

<script lang="ts">
import {
  SvelteFlow,
  Controls,
  Background,
  BackgroundVariant,
  MiniMap,
} from '@xyflow/svelte';

import '@xyflow/svelte/style.css'

const nodes = $state.raw([
  {
    id: '1',
    type: 'input',
    data: { label: 'Input Node' },
    position: { x: 0, y: 0 }
  },
  {
    id: '2',
    type: 'custom',
    data: { label: 'Node' },
    position: { x: 0, y: 150 }
  }
]);

const edges = $state.raw([
  {
    id: '1-2',
    type: 'default',
    source: '1',
    target: '2',
    label: 'Edge Text'
  }
]);
</script>

<SvelteFlow
bind:nodes
bind:edges
fitView
on:nodeclick={(event) => console.log('on node click', event)}
>
<Controls />
<Background variant={BackgroundVariant.Dots} />
<MiniMap />
</SvelteFlow>

Releases

For releasing packages we are using changesets in combination with the changeset Github action. The rough idea is:

  1. create PRs for new features, updates and fixes (with a changeset if relevant for changelog)
  2. merge into main
  3. changeset creates a PR that bumps all packages based on the changesets
  4. merge changeset PR if you want to release to Github and npm

Built by xyflow

React Flow, Svelte Flow and Vue Flow are maintained by the xyflow team. 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.

License

React Flow, Svelte Flow and Vue Flow are MIT licensed.

Live data via GitHub REST API · Cached 30 min · Created 15 Jul 2019