Skip to Content
📣 We just released Svelte Flow 1.0 Alpha — try it out and give us your feedback!
ExamplesEdgesReconnect Edge

Reconnect Edge

You can make edges reconnectable by using the <EdgeReconnectAnchor /> component. This component is used to create a reconnection point on your custom edges. They behave similar to handles:

  1. You can start dragging on an <EdgeReconnectAnchor />
  2. This starts a new connection process and from the oppsite side of the edge
  3. You can finish the connection the same way as it had been started from a handle
<script lang="ts"> import { SvelteFlow, Background, type Node, type Edge, type EdgeTypes, } from '@xyflow/svelte'; import '@xyflow/svelte/dist/style.css'; import { initialNodes, initialEdges } from './nodes-and-edges'; import CustomEdge from './CustomEdge.svelte'; let nodes = $state.raw<Node[]>(initialNodes); let edges = $state.raw<Edge[]>(initialEdges); const edgeTypes: EdgeTypes = { custom: CustomEdge, }; </script> <SvelteFlow bind:nodes bind:edges {edgeTypes} fitView> <Background /> </SvelteFlow>
Last updated on