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

<NodeResizeControl />

Source on GitHub 

The <NodeResizeControl /> component renders a single resize control, so you can place and style resize handles individually — as opposed to <NodeResizer />, which renders the full set at once.

<!-- ResizableNode.vue --> <script setup lang="ts"> import { Handle, NodeResizeControl, Position, type NodeProps } from '@xyflow/vue'; defineProps<NodeProps>(); </script> <template> <NodeResizeControl position="bottom-right" :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 <NodeResizeControl /> component is exported as ResizeControlProps.

NameTypeDefault
nodeIdstring

Id of the node it is resizing.

colorstring

Color of the resize handle.

minWidthnumber

Minimum width of node.

10
minHeightnumber

Minimum height of node.

10
maxWidthnumber

Maximum width of node.

Number.MAX_VALUE
maxHeightnumber

Maximum height of node.

Number.MAX_VALUE
positionControlLinePosition | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'

Position of the control.

variantResizeControlVariant

Variant of the control.

"handle"
resizeDirection'horizontal' | 'vertical'

The direction the user can resize the node in.

When left unset the node can be resized in any direction.

shouldResize(event: ResizeDragEvent, params: ResizeParamsWithDirection) => boolean

Callback to determine if node should resize.

keepAspectRationumber | boolean

Keep aspect ratio when resizing.

false
autoScaleboolean

Scale the controls with the zoom level.

true
handleClassNamestring

Class name applied to handle.

handleStyleCSSProperties

Style applied to handle.

lineClassNamestring

Class name applied to line.

lineStyleCSSProperties

Style applied to line.

isVisibleboolean

Are the controls visible.

true
onResize((resizeEvent: OnResize) => any) | undefined
onResizeStart((resizeEvent: OnResizeStart) => any) | undefined
onResizeEnd((resizeEvent: OnResizeEnd) => any) | undefined

Notes

  • Use the position prop to choose which corner or edge the control sits on, and variant to switch between a handle and a line control.
  • Like <NodeResizer />, it emits resize-start, resize, and resize-end.