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

<ControlButton />

Source on GitHub 

The <ControlButton /> component adds a button to the <Controls /> panel, styled to match the built-in zoom and fit-view buttons.

<script setup lang="ts"> import { shallowRef } from 'vue'; import { ControlButton, Controls, VueFlow } from '@xyflow/vue'; const nodes = shallowRef([]); const edges = shallowRef([]); </script> <template> <VueFlow v-model:nodes="nodes" v-model:edges="edges"> <Controls> <ControlButton @click="onCopy"> <CopyIcon /> </ControlButton> </Controls> </VueFlow> </template>

Props

NameTypeDefault
disabledboolean

Whether the button is disabled.

labelstring

Accessible label for the button, used as both aria-label and title.

onClick((event: MouseEvent) => any) | undefined

Notes

  • The button content is provided through the default slot, so you can drop in any icon or element.
  • <ControlButton /> emits click with the native MouseEvent.