1
0
Fork 0
mirror of https://github.com/xyflow/xyflow.git synced 2026-04-25 09:16:06 +03:00
No description
Find a file
2026-03-27 12:51:04 +01:00
.changeset chore(packages): bump 2026-03-25 12:49:44 +00:00
.github Add github action to codespell main on push and PRs 2026-03-02 08:19:21 -05:00
examples address review: reset spy history before remount, add changeset 2026-03-23 09:18:52 +08:00
packages chore(packages): bump 2026-03-25 12:49:44 +00:00
tests/playwright [DATALAD RUNCMD] Fix non-ambiguous typos with codespell 2026-03-02 08:22:21 -05:00
tooling fix linting and linting errors. remove unused svelte prop 2025-06-11 15:30:28 +02:00
.coderabbit.yaml feat(reviews): add coderabbit config 2025-10-27 12:18:48 +01:00
.codespellrc Do not wild exclude .git*, so we could codespell .github/ workflows 2026-03-03 11:50:42 -05:00
.gitattributes chore(git): add gitattributes 2020-10-08 00:44:05 +02:00
.gitignore Add .npm to .gitignore 2026-03-02 08:22:05 -05:00
.npmrc chore(package): bump 2024-01-03 23:53:51 +01:00
.prettierignore chore(dot-files): cleanup 2022-08-08 15:50:53 +02:00
.prettierrc.json chore(dot-files): cleanup 2022-08-08 15:50:53 +02:00
CHANGELOG.md chore(changelog): add link to releases page 2020-10-20 15:26:58 +02:00
CODE_OF_CONDUCT.md [DATALAD RUNCMD] Fix non-ambiguous typos with codespell 2026-03-02 08:22:21 -05:00
CONTRIBUTING.md Revise CONTRIBUTING.md 2026-01-05 12:37:14 +01:00
dependabot.yml add dependabot.yaml 2025-09-10 11:50:05 +02:00
LICENSE chore(license): happy new year 2025-10-14 13:03:55 +02:00
package.json fix linting and linting errors. remove unused svelte prop 2025-06-11 15:30:28 +02:00
pnpm-lock.yaml fix edgeToolbar and remove minimum Svelte version bump 2025-12-03 11:19:34 +01:00
pnpm-workspace.yaml fixed tests for react & added scripts to package.json 2023-11-08 11:22:20 +01:00
README.md Typo README.md 2025-11-16 19:31:47 +01:00
SECURITY.md chore(typo) 2025-10-20 11:12:51 +02:00
turbo.json Chore/turbo v2 (#4359) 2024-06-11 16:05:36 +02:00

xyflow-header xyflow-header-dark

GitHub License MIT npm downloads npm downloads

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

React Flow · Svelte Flow · React Flow Pro · Discord


The xyflow mono repo

The xyflow repository is the home of four packages:

Commercial usage

Are you using React Flow or Svelte 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 or Svelte Flow at your organization and making money from it? Awesome! We rely on your support to keep our libraries developed and maintained under an MIT License, just how we like it. For React Flow you can do that on the React Flow Pro website and for both of our libraries you can do it through Github Sponsors.

Getting started

The best way to get started is to check out the React Flow or Svelte 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 } from 'react';
import {
ReactFlow,
MiniMap,
Controls,
Background,
useNodesState,
useEdgesState,
addEdge,
} from '@xyflow/react';

import '@xyflow/react/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;
Svelte Flow basic usage

Installation

npm install @xyflow/svelte

Basic usage

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

import '@xyflow/svelte/dist/style.css'

const nodes = writable([
  {
    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 = writable([
  {
    id: '1-2',
    type: 'default',
    source: '1',
    target: '2',
    label: 'Edge Text'
  }
]);
</script>

<SvelteFlow
{nodes}
{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 and Svelte 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 and Svelte Flow are MIT licensed.