Skip to main content

FlowProps

All available configuration options for Vue Flow.

Core Properties

id
string
Unique identifier for the flow instance
nodes
Node[]
Array of nodes in the flow
edges
Edge[]
Array of edges in the flow
modelValue
Elements
Deprecated - use nodes and edges instead
All elements (nodes + edges)

Node & Edge Types

nodeTypes
NodeTypesObject
Custom node type components. Alternative to using slots
edgeTypes
EdgeTypesObject
Custom edge type components. Alternative to using slots

Connection Settings

connectionMode
ConnectionMode
Connection mode: 'strict' or 'loose'. Default: 'strict'
connectionLineOptions
ConnectionLineOptions
Options for the connection line appearance and behavior
connectionRadius
number
Radius around handles where connections can be made
isValidConnection
ValidConnectionFunc | null
Function to validate connections before they are created
autoConnect
boolean | Connector
Deprecated - will be removed in next major release
Automatically create edges when connections are made
connectOnClick
boolean
Allow connections with click handlers (useful for touch devices)

Interaction Settings

nodesDraggable
boolean
Enable/disable dragging for all nodes. Default: true
nodesConnectable
boolean
Enable/disable connecting for all nodes. Default: true
elementsSelectable
boolean
Enable/disable selecting elements. Default: true
selectNodesOnDrag
boolean
Select nodes when dragging. Default: true
edgesUpdatable
EdgeUpdatable
Enable/disable updating edges. Can be boolean, 'source', or 'target'
nodeDragThreshold
number
Distance in pixels before drag is triggered. Default: 0

Keyboard Settings

deleteKeyCode
KeyFilter | null
Key(s) to delete selected elements. Default: 'Backspace'
selectionKeyCode
KeyFilter | boolean | null
Key(s) to enable selection mode. Default: 'Shift'
multiSelectionKeyCode
KeyFilter | null
Key(s) to enable multi-selection. Default: 'Meta' (Cmd/Ctrl)
zoomActivationKeyCode
KeyFilter | null
Key(s) to enable zoom. Default: 'Meta'
panActivationKeyCode
KeyFilter | null
Key(s) to enable panning. Default: 'Space'
disableKeyboardA11y
boolean
Disable keyboard accessibility features

Viewport & Zoom

defaultViewport
Partial<ViewportTransform>
Initial viewport position and zoom level
minZoom
number
Minimum zoom level. Default: 0.5
maxZoom
number
Maximum zoom level. Default: 2
zoomOnScroll
boolean
Enable zoom on scroll. Default: true
zoomOnPinch
boolean
Enable zoom on pinch (touch). Default: true
zoomOnDoubleClick
boolean
Enable zoom on double click. Default: true
panOnScroll
boolean
Enable panning on scroll. Default: false
panOnScrollSpeed
number
Speed of panning when scrolling. Default: 0.5
panOnScrollMode
PanOnScrollMode
Pan direction: 'free', 'vertical', or 'horizontal'. Default: 'free'
panOnDrag
boolean | number[]
Enable panning by dragging. Can be boolean or array of mouse buttons. Default: true
preventScrolling
boolean
Prevent page scrolling inside viewport. Default: true
paneClickDistance
number
Distance that mouse can move between mousedown/up to trigger click. Default: 0

Extent & Boundaries

translateExtent
CoordinateExtent
Limits for panning the viewport
nodeExtent
CoordinateExtent | CoordinateExtentRange
Default extent for all nodes

Grid & Snapping

snapToGrid
boolean
Enable snapping nodes to grid. Default: false
snapGrid
SnapGrid
Grid size as [x, y]. Default: [15, 15]

Selection

selectionMode
SelectionMode
Selection mode: 'partial' or 'full'. Default: 'full'

Performance

onlyRenderVisibleElements
boolean
Only render elements visible in viewport. Default: false

Auto Pan

autoPanOnConnect
boolean
Auto pan when connecting near viewport edges. Default: true
autoPanOnNodeDrag
boolean
Auto pan when dragging nodes near viewport edges. Default: true
autoPanSpeed
number
Speed of auto panning. Default: 15

Initial Behavior

fitViewOnInit
boolean
Fit view to nodes on initialization. Default: false

Edge Settings

defaultEdgeOptions
DefaultEdgeOptions
Default options applied to new edges
edgeUpdaterRadius
number
Radius of edge updater handles. Default: 10
defaultMarkerColor
string
Default color for edge markers. Default: '#b1b1b7'
elevateEdgesOnSelect
boolean
Elevate edges when selected using z-index. Default: false

Focus

nodesFocusable
boolean
Enable focus for nodes (a11y). Default: true
edgesFocusable
boolean
Enable focus for edges (a11y). Default: true
elevateNodesOnSelect
boolean
Elevate nodes when selected using z-index + 1000. Default: false

Class Names

noDragClassName
string
Class name to disable dragging. Default: 'nodrag'
noWheelClassName
string
Class name to disable wheel events. Default: 'nowheel'
noPanClassName
string
Class name to disable panning. Default: 'nopan'

Changes

applyDefault
boolean
Deprecated - will be removed in next major release
Apply default change handlers automatically. Default: true

ViewportTransform

Represents the viewport transformation state.
interface ViewportTransform {
  x: number
  y: number
  zoom: number
}
x
number
required
X translation of viewport
y
number
required
Y translation of viewport
zoom
number
required
Zoom level of viewport

FlowExportObject

Object structure for exporting flow state.
nodes
Node[]
Exported nodes
edges
Edge[]
Exported edges
viewport
ViewportTransform
Exported viewport (position + zoom)
position
[number, number]
Deprecated - use viewport instead
Exported viewport position
zoom
number
Deprecated - use viewport instead
Exported zoom level

Example

import { toObject } from '@vue-flow/core'

const flowObject: FlowExportObject = toObject()

console.log(flowObject)
// {
//   nodes: [...],
//   edges: [...],
//   viewport: { x: 0, y: 0, zoom: 1 }
// }

FlowImportObject

Partial flow state for importing.
type FlowImportObject = { 
  [key in keyof FlowExportObject]?: FlowExportObject[key] 
}
All properties are optional, allowing partial imports.

SelectionMode

Enum for selection behavior.
enum SelectionMode {
  Partial = 'partial',
  Full = 'full'
}
  • Partial: Elements are selected if they partially overlap the selection box
  • Full: Elements are selected only if fully contained in the selection box

Position

Enum for handle positions.
enum Position {
  Left = 'left',
  Top = 'top',
  Right = 'right',
  Bottom = 'bottom'
}

XYPosition

2D coordinate position.
interface XYPosition {
  x: number
  y: number
}

Dimensions

Size dimensions.
interface Dimensions {
  width: number
  height: number
}

Rect

Rectangle with position and dimensions.
interface Rect extends Dimensions, XYPosition {}
Combines XYPosition and Dimensions.

Box

Bounding box coordinates.
interface Box extends XYPosition {
  x2: number
  y2: number
}
x
number
required
Left coordinate
y
number
required
Top coordinate
x2
number
required
Right coordinate
y2
number
required
Bottom coordinate

SnapGrid

Grid size for snapping.
type SnapGrid = [x: number, y: number]

Example

const snapGrid: SnapGrid = [20, 20] // 20px grid

Styles

Extended CSS properties with theme vars.
type Styles = CSSProperties & ThemeVars & CustomThemeVars

ThemeVars

Built-in CSS custom properties:
  • --vf-node-color
  • --vf-box-shadow
  • --vf-node-bg
  • --vf-node-text
  • --vf-connection-path
  • --vf-handle

Example

const styles: Styles = {
  '--vf-node-bg': '#ffffff',
  '--vf-node-color': '#000000',
  backgroundColor: 'var(--vf-node-bg)',
  border: '1px solid #ddd'
}

Build docs developers (and LLMs) love