Core Composables
useVueFlow
Main composable providing access to the entire flow state and actions
useNode
Access node data, parent node, and connected edges
useEdge
Access edge data and DOM element
useHandle
Handle connection events and validation
Node & Edge Data
useNodesData
Access reactive node data by ID(s)
useEdgesData
Access reactive edge data by ID(s)
useNodeId
Get the current node ID from context
useNodesInitialized
Check if specific nodes are initialized
Connection State
useConnection
Access current connection state during connection
useHandleConnections
Get all connections for a specific handle
useNodeConnections
Get all connections for a specific node
Utilities
useZoomPanHelper
Helper functions for viewport manipulation
useGetPointerPosition
Get pointer position relative to flow
useKeyPress
React to keyboard events
Usage Examples
Composable Categories
State Management
useVueFlow- Complete flow state accessuseNode- Node-specific stateuseEdge- Edge-specific state
Data Access
useNodesData- Reactive node datauseEdgesData- Reactive edge datauseNodeId- Context-based ID access
Connection Management
useHandle- Handle event listenersuseConnection- Active connection stateuseHandleConnections- Handle connection listuseNodeConnections- Node connection list
Viewport & Interaction
useZoomPanHelper- Viewport controlsuseGetPointerPosition- Pointer trackinguseKeyPress- Keyboard interaction
Initialization
useNodesInitialized- Node initialization status
TypeScript Support: All composables are fully typed with TypeScript. You can provide generic type parameters for custom node/edge data:
Context Requirements
Some composables require being called within a Vue Flow context:useNode- Must be called within a custom node component or its childrenuseEdge- Must be called within a custom edge component or its childrenuseNodeId- Must be called within a node contextuseVueFlow- Can create a new instance or access existing context
For detailed information about each composable, including parameters, return values, and advanced usage patterns, refer to the individual composable documentation pages.