2026-11-18
Svelte Flow 2.0.0
Major Changes
- #6114 - Align the connection APIs across all frameworks on
NodeConnection.- Remove
getHandleConnections. UsegetNodeConnections({ nodeId, type, handleId })instead:idis renamed tohandleIdandtypeis optional. - Add
getNodeConnectionstouseSvelteFlow. HandleConnectiontype removed: useNodeConnectioninstead.
- Remove
- #6082 - Removed setters from
useNodesanduseEdgesin favor of better change handling viaupdateNode&updateEdgeinuseSvelteFlow. - #6117 -
onConnectEndandonReconnectEndnow receivetoin flow coordinates instead of screen coordinates - #5965 - Removed
useColorModehook. - #5915 - Remove requirement of parent nodes to appear before child nodes in the nodes array
- #5927 - Use 5% as new default padding for
fitView, andfitBounds. - #6115 - Replace
paneClickDistancewithpaneDragThreshold(default1). LikenodeDragThreshold, the pane only starts panning or selecting once the pointer has moved further than the threshold; otherwise it counts as a click. Works with every mouse button. - #5843 - Use system color mode by default, add
forceColorModeto opt-out. - #5556 - Remove
nodeClickDistance. Whether a click on a node fires is now determined solely by whether a drag actually moved the node: clicks are suppressed only after a drag changed node positions. UsenodeDragThreshold(andsnapGrid) to control this. - #5987 - Rename the measured handle geometry type from
HandletoHandleBoundsso it no longer collides with the<Handle />component. - #5927 - Numbers passed to
fitViewOptions.paddingare interpreted as pixel values instead of legacy units. Use percentage values instead (0.1 ≈ 4.5%, 0.5 ≈ 16.7%, 1 ≈ 25%, 2 ≈ 33%) - #5944 - Pass
NodeChangeset/EdgeChangesetclass toonNodesChange/onEdgesChangeoronnodeschange/onedgeschange. - #5967 - Rename
useStoretouseSvelteFlowStore - #5842 - Hooks do not require to be $derived anymore and accept a function parameter instead.
Minor Changes
- #5866 - Add style import from
@xyflow/svelte/style.css. - #5939 - Add
changeParenttouseReactFlow,useSvelteFlowanduseVueFlow, to easily change the parent of a node without calculating a new position. - #6082 - Control and monitor any changes to your nodes & edges via
onnodeschange&onedgeschange. Clearing a changeset withchanges.clear()inonnodeschangeprevents automatic application of changes. Use it to manually manage changes to nodes & edges. - #5844 - Exported styles now live in
@layer xyflow. - #6029 - Improve panning performance by avoiding a full style recalculation when the pane cursor changes.
- #5993 - Add
xy-theme.cssstylesheet (@xyflow/svelte/xy-theme.css) that ships the xyflow default theme on top ofbase.css. - #5939 - Add
useNodeanduseEdgehooks for subscribing to changes to specific nodes & edges
Patch Changes
- #5866 - Include source maps and src folder in package. “Go to definition” now links to the source code instead of the generated types
- #6064 - Stop an interrupted animated
fitViewfrom running again on every later nodes change, for example while dragging a node - #6084 - Fix resizing nodes with a fixed extent & a non-default origin.
- #6115 - Fire the pane context menu event when right-click panning is enabled (
panOnDragincludes2). - #5989 - Prevent jumping nodes when origin node option is used
- #6064 - Resolve the promises of animated viewport functions like
fitViewandsetCenterwithfalsewhen a user interaction or another viewport change interrupts the animation, instead of leaving them pending - #6131 - Narrow
databytypewhenNodePropsreceives a union of node types. - #5996 - Performance: Optimize processing of nodes & edges
