<NodeResizer />
The <NodeResizer /> component renders draggable controls around a node so users
can resize it. Drop it into a custom node.
<!-- ResizableNode.vue -->
<script setup lang="ts">
import { Handle, NodeResizer, Position, type NodeProps } from '@xyflow/vue';
defineProps<NodeProps>();
</script>
<template>
<NodeResizer :min-width="100" :min-height="30" />
<Handle type="target" :position="Position.Left" />
<div>{{ data.label }}</div>
<Handle type="source" :position="Position.Right" />
</template>Props
The type for props of <NodeResizer /> component is exported as NodeResizerProps.
Notes
<NodeResizer />emitsresize-start,resize, andresize-endthroughout a resize interaction.- Constrain resizing with
minWidth/minHeight/maxWidth/maxHeight, or keep proportions withkeepAspectRatio. - For a single resize control (e.g. only the bottom-right corner) use
<NodeResizeControl />.