Live Demo
View the live demo on vueflow.dev.Complete Example
Key Concepts
Registering Custom Nodes
Use the#node-{type} template slot to register custom node components:
type property of your node.
Node Props
Custom node components receive these props:Adding Handles
Handles are connection points on nodes. Use theHandle component:
When using multiple handles of the same type, you must provide unique
id props.Handle Positions
Handles can be positioned on any side of the node:- Positions
- Custom Styling
Node Data
Pass custom data to nodes through thedata property:
Advanced Features
Preventing Drag on Interactive Elements
Add thenodrag class to prevent dragging when interacting with inputs:
Snap to Grid
Make nodes snap to a grid while dragging:Custom MiniMap Colors
Customize node colors in the minimap:TypeScript Support
Define types for your custom nodes:Best Practices
Always add
inheritAttrs: false to custom node components to prevent attribute conflicts:Next Steps
Custom Edges
Learn how to create custom edge components
Validation
Validate connections between nodes
Node API
Complete node type reference
Handle Component
Handle component documentation