<EdgeToolbar />
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.
Notes
- Position the toolbar with
x/y(typically the edge’s label coordinates from a path helper) and fine-tune withalignX/alignY.