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
| Name | Type | Default |
|---|---|---|
id | stringUnique id of a node. | |
data | NodeType["data"]Arbitrary data passed to a node. | |
type | NodeType["type"]Type of node defined in | |
selected | booleanWhether the node is currently selected. | |
selectable | booleanWhether the node can be selected. | |
deletable | booleanWhether the node can be deleted. | |
draggable | booleanWhether or not the node is able to be dragged. | |
dragging | booleanWhether or not the node is currently being dragged. | |
zIndex | numberThe node’s z-index. | |
isConnectable | booleanWhether a node is connectable or not. | |
positionAbsoluteX | numberPosition absolute x value. | |
positionAbsoluteY | numberPosition absolute y value. | |
width | NodeType["width"]The node’s width, in pixels. | |
height | NodeType["height"]The node’s height, in pixels. | |
sourcePosition | NodeType["sourcePosition"]Only relevant for default, source, target nodeType. Controls source position. | |
targetPosition | NodeType["targetPosition"]Only relevant for default, source, target nodeType. Controls target position. | |
dragHandle | NodeType["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. | |
parentId | NodeType["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 withuseNode()/useInternalNode().