Use when building node-based UIs, flow diagrams, workflow editors, or interactive graphs with Svelte Flow. Covers setup, nodes, edges, controls, and interactivity.
View on GitHubTheBushidoCollective/han
svelteflow
February 5, 2026
Select agents to install to:
npx add-skill https://github.com/TheBushidoCollective/han/blob/main/frameworks/svelteflow/skills/svelteflow-fundamentals/SKILL.md -a claude-code --skill svelteflow-fundamentalsInstallation paths:
.claude/skills/svelteflow-fundamentals/# Svelte Flow Fundamentals
Build customizable node-based editors and interactive diagrams with Svelte Flow.
This skill covers core concepts, setup, and common patterns for creating
flow-based interfaces in Svelte applications.
## Installation
```bash
# npm
npm install @xyflow/svelte
# pnpm
pnpm add @xyflow/svelte
# yarn
yarn add @xyflow/svelte
```
## Basic Setup
```svelte
<script lang="ts">
import {
SvelteFlow,
Controls,
Background,
MiniMap,
type Node,
type Edge,
} from '@xyflow/svelte';
import { writable } from 'svelte/store';
import '@xyflow/svelte/dist/style.css';
const nodes = writable<Node[]>([
{
id: '1',
type: 'input',
data: { label: 'Start' },
position: { x: 250, y: 0 },
},
{
id: '2',
data: { label: 'Process' },
position: { x: 250, y: 100 },
},
{
id: '3',
type: 'output',
data: { label: 'End' },
position: { x: 250, y: 200 },
},
]);
const edges = writable<Edge[]>([
{ id: 'e1-2', source: '1', target: '2' },
{ id: 'e2-3', source: '2', target: '3' },
]);
</script>
<div style="height: 100vh; width: 100vw;">
<SvelteFlow {nodes} {edges} fitView>
<Controls />
<Background />
<MiniMap />
</SvelteFlow>
</div>
```
## Using Stores for State
```svelte
<script lang="ts">
import { SvelteFlow, type Node, type Edge } from '@xyflow/svelte';
import { writable, derived } from 'svelte/store';
// Writable stores for reactive state
const nodes = writable<Node[]>([
{ id: '1', data: { label: 'Node 1' }, position: { x: 0, y: 0 } },
{ id: '2', data: { label: 'Node 2' }, position: { x: 200, y: 100 } },
]);
const edges = writable<Edge[]>([
{ id: 'e1-2', source: '1', target: '2' },
]);
// Derived store for computed values
const nodeCount = derived(nodes, ($nodes) => $nodes.length);
const edgeCount = derived(edges, ($edges) => $edges.length);
// Add a new node
function addNode() {
con