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

NodeProps

The NodeProps type is the set of props Vue Flow passes to a custom node component — id, data, type, selected, dragging, positionAbsoluteX / positionAbsoluteY, and more. Declare it in your node with defineProps<NodeProps>().

Fields

NameTypeDefault
idstring

Unique id of a node.

dataNodeType["data"]

Arbitrary data passed to a node.

typeNodeType["type"]

Type of node defined in nodeTypes.

selectedboolean

Whether the node is currently selected.

selectableboolean

Whether the node can be selected.

deletableboolean

Whether the node can be deleted.

draggableboolean

Whether or not the node is able to be dragged.

draggingboolean

Whether or not the node is currently being dragged.

zIndexnumber

The node’s z-index.

isConnectableboolean

Whether a node is connectable or not.

positionAbsoluteXnumber

Position absolute x value.

positionAbsoluteYnumber

Position absolute y value.

widthNodeType["width"]

The node’s width, in pixels.

heightNodeType["height"]

The node’s height, in pixels.

sourcePositionNodeType["sourcePosition"]

Only relevant for default, source, target nodeType. Controls source position.

targetPositionNodeType["targetPosition"]

Only relevant for default, source, target nodeType. Controls target position.

dragHandleNodeType["dragHandle"]

A class name that can be applied to elements inside the node that allows those elements to act as drag handles, letting the user drag the node by clicking and dragging on those elements.

parentIdNodeType["parentId"]

Parent node id, used for creating sub-flows.

Notes

  • Vue Flow doesn’t pass the whole node object to a custom node. If you need fields that aren’t in NodeProps (e.g. the parent node or connected edges), resolve them with useNode() / useInternalNode().