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

<EdgeToolbar />

Source on GitHub 

The <EdgeToolbar /> component renders a toolbar positioned on an edge — the edge counterpart to <NodeToolbar />, handy for per-edge actions like deleting or editing a connection. It is a Vue Flow addition with no React/Svelte Flow equivalent.

<!-- CustomEdge.vue --> <script setup lang="ts"> import { BaseEdge, EdgeToolbar, getBezierPath, type EdgeProps } from '@xyflow/vue'; import { computed } from 'vue'; const props = defineProps<EdgeProps>(); const path = computed(() => getBezierPath(props)); </script> <template> <BaseEdge :id="id" :path="path[0]" /> <EdgeToolbar :edge-id="id" :x="path[1]" :y="path[2]" is-visible> <button>delete</button> </EdgeToolbar> </template>

Props

The type for props of <EdgeToolbar /> component is exported as EdgeToolbarProps.

NameTypeDefault
xnumber

The x position of the edge toolbar.

ynumber

The y position of the edge toolbar.

isVisibleboolean

If true, edge toolbar is visible even if edge is not selected.

false
alignX"left" | "center" | "right"

Align the vertical toolbar position relative to the passed x position.

"center"
alignY"center" | "top" | "bottom"

Align the horizontal toolbar position relative to the passed y position.

"center"
edgeIdstring

The id of the edge the toolbar belongs to.

Notes

  • Position the toolbar with x / y (typically the edge’s label coordinates from a path helper) and fine-tune with alignX / alignY.