Skip to Content
Svelte Flow 2 is out! Read the announcement →
Examples

Feature Overview

This is an overview example of what’s possible with Svelte Flow. Below you can see features like: built-in node and edge types, sub flows, NodeToolbar, NodeResizer components. On the bottom you see the Controls and the MiniMap components.

<script lang="ts"> import { SvelteFlow, Background, Controls, MiniMap, type NodeTypes, type EdgeTypes, type Edge, type Node, } from '@xyflow/svelte'; import { initialNodes, initialEdges } from './nodes-and-edges'; import AnnotationNode from './AnnotationNode.svelte'; import ButtonEdge from './ButtonEdge.svelte'; import CircleNode from './CircleNode.svelte'; import ResizerNode from './ResizerNode.svelte'; import ToolbarNode from './ToolbarNode.svelte'; import TextNode from './TextNode.svelte'; import './index.css'; const nodeTypes: NodeTypes = { annotation: AnnotationNode, tools: ToolbarNode, circle: CircleNode, resizer: ResizerNode, textinput: TextNode, }; const edgeTypes: EdgeTypes = { button: ButtonEdge, }; let nodes = $state.raw<Node[]>(initialNodes); let edges = $state.raw<Edge[]>(initialEdges); </script> <SvelteFlow class="overview" bind:nodes bind:edges {nodeTypes} {edgeTypes} fitView > <Background patternColor="#aaa" gap={16} /> <Controls /> <MiniMap zoomable pannable height={120} nodeClass={(node) => node.type} /> </SvelteFlow>