MCPcopy
hub / github.com/xyflow/xyflow

github.com/xyflow/xyflow @xyflow-react-12.11.0.tgz sqlite

repository ↗ · DeepWiki ↗ · release xyflow-react-12.11.0.tgz ↗
862 symbols 2,524 edges 454 files 10 documented · 1%
README

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: * React Flow 12 @xyflow/react packages/react * React Flow 11 reactflow v11 branch * Svelte Flow @xyflow/svelte packages/svelte * Shared helper library @xyflow/system packages/system

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

sh npm install @xyflow/react

### Basic usage ```jsx 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 ( ); }

export default Flow;










<strong>Svelte Flow</strong> basic usage



  ### Installation

  ```sh
npm install @xyflow/svelte
  ```

  ### Basic usage
  ```svelte
<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.

Extension points exported contracts — how you extend this code

ReactFlowProps (Interface)
(no doc)
packages/react/src/types/component-props.ts
GetSmoothStepPathParams (Interface)
(no doc)
packages/system/src/utils/edges/smoothstep-edge.ts
EdgeLayoutBaseOptions (Interface)
(no doc)
packages/svelte/src/lib/store/visibleElements.ts
FlowConfig (Interface)
(no doc)
examples/react/src/app.d.ts
FlowConfig (Interface)
(no doc)
examples/svelte/src/app.d.ts
EdgeAnchorProps (Interface)
(no doc)
packages/react/src/components/Edges/EdgeAnchor.tsx
EdgeLayoutAllOptions (Interface)
(no doc)
packages/svelte/src/lib/store/visibleElements.ts
IRoute (Interface)
(no doc)
examples/react/src/App/routes.ts

Core symbols most depended-on inside this repo

setEdges
called by 75
packages/react/src/hooks/useReactFlow.ts
setNodes
called by 59
packages/react/src/hooks/useReactFlow.ts
useStore
called by 58
packages/react/src/hooks/useStore.ts
addEdge
called by 53
packages/react/src/utils/edges.ts
useNodesState
called by 48
packages/react/src/hooks/useNodesEdgesState.ts
useEdgesState
called by 47
packages/react/src/hooks/useNodesEdgesState.ts
useStoreApi
called by 31
packages/react/src/hooks/useStore.ts
useReactFlow
called by 27
packages/react/src/hooks/useReactFlow.ts

Shape

Function 825
Interface 13
Method 11
Enum 9
Class 4

Languages

TypeScript100%

Modules by API surface

packages/system/src/utils/general.ts30 symbols
examples/react/src/examples/Overview/index.tsx27 symbols
packages/svelte/src/lib/store/index.ts25 symbols
examples/react/src/examples/Basic/index.tsx15 symbols
packages/system/src/utils/store.ts14 symbols
packages/system/src/utils/graph.ts14 symbols
packages/system/src/xypanzoom/XYPanZoom.ts13 symbols
packages/react/src/container/Pane/index.tsx13 symbols
packages/svelte/src/lib/store/initial-store.svelte.ts10 symbols
examples/react/src/examples/Subflow/index.tsx10 symbols
examples/react/src/examples/Stress/performanceUtils.ts10 symbols
examples/react/src/examples/InteractiveMinimap/index.tsx10 symbols

Dependencies from manifests, versioned

@astrojs/react5.0.5 · 1×
@astrojs/svelte8.1.2 · 1×
@changesets/changelog-github0.7.0 · 1×
@changesets/cli2.31.0 · 1×
@cypress/skip-test2.6.1 · 1×
@dagrejs/dagre1.1.8 · 1×
@eslint/compat2.0.0 · 1×
@eslint/js9.39.1 · 1×
@playwright/experimental-ct-react1.51.1 · 1×
@playwright/test1.44.1 · 1×
@reduxjs/toolkit2.2.3 · 1×
@rollup/plugin-commonjs25.0.8 · 1×

For agents

$ claude mcp add xyflow \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact