Installation
Don’t forget to import the styles:
import '@vue-flow/minimap/dist/style.css'Usage
Props
Color for nodes in the minimap. Can be a static color string or a function that returns a color based on the node.
Stroke color for nodes in the minimap. Can be a static color or a function.
Additional CSS class name(s) for nodes. Can be a static string or a function that returns a class name.
Border radius for node shapes in the minimap.
Width of the node stroke in the minimap.
Color of the viewport mask overlay.
Stroke color for the viewport mask border.
Width of the viewport mask border.
Border radius for the viewport mask.
Position of the minimap on the canvas.Options:
'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'Enable dragging the minimap to pan the main viewport.
Enable scrolling on the minimap to zoom the main viewport.
Invert the panning direction when dragging the minimap.
Step size for zooming when
zoomable is enabled.Width of the minimap in pixels.
Height of the minimap in pixels.
ARIA label for accessibility. Set to
null to disable.Scale factor for the minimap offset/padding.
Events
Emitted when the minimap background is clicked.
Emitted when a node in the minimap is clicked.
Emitted when a node in the minimap is double-clicked.
Emitted when the mouse enters a node in the minimap.
Emitted when the mouse moves over a node in the minimap.
Emitted when the mouse leaves a node in the minimap.
Slots
node-{type}
Custom slot for rendering specific node types in the minimap. Replace
{type} with your node type.Receives MiniMapNodeProps:Examples
Interactive MiniMap
Custom Node Colors
Custom Position and Size
Handle Node Events
TypeScript
Exports
MiniMap- The main MiniMap componentMiniMapNode- Internal component for rendering nodes (can be used for custom implementations)MiniMapProps- TypeScript interface for MiniMap propsMiniMapNodeFunc- Type for node styling functionsMiniMapNodeProps- TypeScript interface for minimap node properties