Timeline
What's new?
Here you can find the latest news about the Svelte Flow library and the docs.

New release 0.0.35
Minor changes
- add
getNode,getNodes,getEdgeandgetEdgestouseSvelteFlow - add
useInitialized/useNNodesInitializedhooks andoninithandler
Patch changes
- selection box is not interrupted by selectionKey being let go
- Edge label has a default background and is clickable
- fix
getNodesBoundsand add second param for passing options
You can find the changelog with all previous changes on Github (opens in a new tab).

New release 0.0.34
Minor changes
- add comments for types like
SvelteFlowPropsorNodefor a better developer experience - add slot for
<Controls />to be able to add custom controls - add option param to
screenToFlowPositionfor configuring ifsnapToGridshould be used - infer types for
getIncomers,getOutgoers,updateEdge,addEdgeandgetConnectedEdges
You can find the changelog with all previous changes on Github (opens in a new tab).

New release 0.0.33
⚠️ Breaking
deleteElementsfunction (opens in a new tab) now takes one object as an argument{ nodes: [], edges: [] }instead of two(nodes, edges)
Bugfixes
- fix
deleteElements - fix dragging when
draggable=false - add
ariaLabelprop for<Controls />
You can find the changelog with all previous changes on Github (opens in a new tab).

NodeResizer - 0.0.32 release
With the latest release, we added the <NodeResizer /> component to the @xyflow/svelte package. Check out the Node Resizer example to see it in action.
You can find the changelog with all previous changes on Github (opens in a new tab).

New Release 0.0.29
Another huge update for Svelte Flow 🙏 Creating reactive flows will be way easier with the new hooks and functions. You can now subscribe to connected nodes, receive data and update nodes more easily. We fix a big issue about the <Handle /> component. No more on:connect that only worked for target <Handle /> components but onconnect and ondisconnect that works for every <Handle />.
Check this Reactive Flow example to see the new helpers in action.
New Features
- add
useHandleConnectionshook for receiving connected node and handle ids for a specific handle - add
useNodesData(ids: string | string[])hook for receiving data from other nodes - new
updateNodeandupdateNodeDataforuseSvelteFlowto update a node or the data object - add
onedgecreatefunction for passing a certain id or other attributes to a newly created edge
Breaking
- replace
on:connect,on:connectstartandon:connectendwithonconnect,onconnectstartandonconnectend, no need to forwardon:connect..anymore
Fixes and minor changes
onconnectandondisconnectcallback work for<Handle />component- don't delete a node when user presses Backspace inside an input/textarea/.nokey element
bgColorprop for Background didn't work- prefix css vars with "xy-"
- don't update nodes and edges on pane click if not necessary
- cleaner types for exported edges
- fix
getIntersectingNodesbug when passingRect

New release 0.0.28
This is a huge update! We added a new <NodeToolbar /> component and a new colorMode ('light' | 'dark' | 'system') prop for toggling dark/light mode. Check out the new dark mode example.
There are some breaking changes again (sorry!) but we are very close to the final API for Svelte Flow 1.0.0. The biggest change is that we group node attriubutes (width, height, positionAbsolute) that are added by the library under node.computed. This makes it easier to understand, that this stuff comes from the library itself. node.width and node.height is still an optional node option and can be used to set certain dimensions for SSR or on the client.
- add
<NodeToolbar />component - add colorMode prop ('light' | 'dark' | 'system') - [Dark mode example]
- add
on:selectionclickandon:selectioncontextmenuevent handlers - add
ondelete({ nodes, edges })handler - add
zoomActivationKeyprop - add
widthandheightprop to customNodePropstype - add
colorModeprop ('light' | 'dark' | 'system') - ⚠️ replace
xPosandyPoswithpositionAbsoluteprop to customNodePropstype - ⚠️
node.width/heightandnode.positionAbsolutecan now be found undernode.computed.width/height/positionAbsolute - ⚠️
node.width/heightis still optional an can be used for forcing certain dimensions and SSR - refactor keys: you can now disable keys by setting them to
null(e.g.selectionKey={null}) - performance optimization with internal node lookup
You can find the changelog with all previous changes on Github (opens in a new tab).

New release 0.0.27
We just released Svelte Flow 0.0.27 with some breaking changes. Even if we try to avoid them, they will happen. We just renamed some functions, so the migration should go easy. Here is a list of all changes:
- ⚠️ rename
screenToFlowCoordinatetoscreenToFlowPosition - ⚠️ rename
flowToScreenCoordinatetoflowToScreenPosition - ⚠️ rename
getTransformForBoundstogetViewportForBounds(return{ x: number, y: number, zoom: number }instead of[number, number, number]) - ⚠️ rename
getRectOfNodestogetNodesBounds - simplify handle default styles, so that it's easier to override them
- add
selectionOnDragprop - can be used to create figma-like controls in combination withpanOnDrag={false}/panOnDrag={[1, 2]}+panOnScroll={true} - 🎉 add e2e tests
You can find the changelog with all previous changes on Github (opens in a new tab).