Skip to Content
Vue Flow v2 is here and joins xyflow! Read more here →

Timeline

What's new?

Here you can find the latest news about the Vue Flow library and the docs.

xyflow team
✌️
9 hours ago

Vue Flow 2.0

Vue Flow 2 is here, and it’s the first release under the xyflow roof! Vue Flow now lives next to React Flow and Svelte Flow in the xyflow repository  and is published as @xyflow/vue. It is built on @xyflow/system, the same framework-agnostic core that powers the other two libraries. You get the same node and edge model, the same function names and the same fixes, in a smaller and faster package.

This release contains breaking changes. Check out the migration guide for everything you need to update when upgrading from Vue Flow 1.x (@vue-flow/core), or jump straight to the cheat sheet.

What changes

  • One package. @xyflow/vue ships every built-in component (Background, Controls, MiniMap, NodeToolbar, NodeResizer), so the separate @vue-flow/* add-ons are gone.
  • Separate bindings for nodes and edges. v-model="elements" is replaced by v-model:nodes and v-model:edges. Use one-way :nodes/:edges with @nodes-change/@edges-change to handle every change yourself.
  • Immutable nodes and edges. In-place mutations like node.position = … are no longer tracked, which makes large flows a lot faster. Update nodes with updateNode/updateNodeData or replace the array.
  • Node and InternalNode. Your nodes stay the plain objects you passed in. Computed fields like the absolute position and the measured size live on the InternalNode, which you can get with getInternalNode(id) or useInternalNode(id).
  • A split store. useVueFlow() returns actions, getters and event hooks, and useVueFlowStore() gives you the reactive state.
  • No global registry. A flow’s store belongs to its <VueFlow>, <VueFlowProvider> or setupVueFlow(), so multiple flows on one page can’t collide.
  • Aligned API. findNode becomes getNode, project becomes screenToFlowPosition, edge updating becomes reconnecting, connectionMode defaults to strict and more, matching React Flow and Svelte Flow.
  • Shared styles. CSS variables use the shared --xy-* names, @xyflow/vue/style.css is the full default theme and theme-default.css is gone.

New features

  • Dark mode. Vue Flow follows the color mode of your site automatically. Use forceColorMode to pin it.
  • A new theme. Import @xyflow/vue/xy-theme.css to get the theme we use for our website and examples.
  • Layered CSS. All styles live in @layer xyflow, so your own styles win without !important.
  • Changesets. @nodes-change and @edges-change receive a NodeChangeset or EdgeChangeset with helpers to read, filter and apply changes.
  • Controlled viewport. Bind the viewport with v-model:viewport.
  • Deleting elements. New deleteElements action, an onBeforeDelete guard and @nodes-delete/@edges-delete/@delete events.
  • changeParent. Move a node to another parent without recalculating its position.
  • More props. ariaLabelConfig, autoPanOnSelection, connectionDragThreshold, paneDragThreshold, selectionOnDrag, a 'cross' background variant and a horizontal <Controls> orientation.

Requirements

Vue Flow 2 requires Vue >=3.5.27 and @vueuse/core v14.

npm uninstall @vue-flow/core @vue-flow/background @vue-flow/controls @vue-flow/minimap @vue-flow/node-resizer @vue-flow/node-toolbar npm install @xyflow/vue@latest

For the full list of changes, see the release notes .

Permalink