<EdgeText />
The <EdgeText /> component renders a label with an optional background at a given
position. It is used by <BaseEdge /> to draw
edge labels, and you can use it directly in a custom edge.
<!-- CustomEdge.vue -->
<script setup lang="ts">
import { BaseEdge, EdgeText, 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]" />
<EdgeText :x="path[1]" :y="path[2]" label="custom label" />
</template>Props
The type for props of <EdgeText /> component is exported as EdgeTextProps.