---
title: "Drag Handle vue extension"
description: "Enable dragging nodes around your vue-based Tiptap Editor with the Drag Handle vue Extension. Learn how to set it up here in the Docs!"
---

> This page is for Tiptap 2.x. [See the latest version of this page.](https://tiptap.dev/docs/editor/extensions/functionality/drag-handle-vue.md)

# Drag Handle vue extension

Enable dragging nodes around your vue-based Tiptap Editor with the Drag Handle vue Extension. Learn how to set it up here in the Docs!

Have you ever wanted to drag nodes around your vue-based editor? Well, we did too—so here’s an extension for that.

The `DragHandleVue` component allows you to easily handle dragging nodes around in the editor. You can define custom render functions, placement, and more.
It essentially wraps the [DragHandle](https://tiptap.dev/docs/v2/editor/extensions/functionality/drag-handle.md) extension in a vue component that will automatically register/unregister the extension with the editor.

> **Interactive demo:** [DragHandle](https://v2--tiptap-embed.netlify.app/preview/Extensions/DragHandle?selectedTab=Vue)

## Install

```bash
npm install @tiptap/extension-drag-handle-vue-3 @tiptap/extension-drag-handle @tiptap/extension-node-range @tiptap/extension-collaboration y-prosemirror yjs y-protocols
```

> **Vue 2 vs. Vue 3**
>
> There are two versions of the DragHandle extension available. Make sure to install the correct
> version for your Vue version. `@tiptap/extension-drag-handle-vue-2` and
> `@tiptap/extension-drag-handle-vue-3`

## Props

All props follow the same structure as the [DragHandle](https://tiptap.dev/docs/v2/editor/extensions/functionality/drag-handle.md) extension.

### children

The content that should be displayed inside of the drag handle.

```vue
<drag-handle>
  <div>Drag Me!</div>
</drag-handle>
```

### tippyOptions

Options for tippy.js. You can pass any options that are available in the [tippy.js documentation](https://atomiks.github.io/tippyjs/v6/all-props/).

Default: `undefined`

```vue
<drag-handle :tippy-options="{ placement: 'left' }">
  <div>Drag Me!</div>
</drag-handle>
```

### onNodeChange

Returns a node or null when a node is hovered over. This can be used to highlight the node that is currently hovered over.

Default: `undefined`

```vue
<template>
  <drag-handle @nodeChange="handleNodeChange">
    <div>Drag Me!</div>
  </drag-handle>
</template>

<script>
import { ref } from 'vue'
import { DragHandle } from '@tiptap/extension-drag-handle-vue-3'

export default {
  components: {
    DragHandle,
  },
  setup() {
    const selectedNode = ref(null)

    const handleNodeChange = ({ node, editor, pos }) => {
      selectedNode.value = node
      // do something with the node
    }

    return {
      selectedNode,
      handleNodeChange,
    }
  },
}
</script>
```

### pluginKey

The key that should be used to store the plugin in the editor. This is useful if you have multiple drag handles in the same editor.

Default: `undefined`

```vue
<drag-handle pluginKey="myCustomDragHandle">
  <div>Drag Me!</div>
</drag-handle>
```

### Commands

See the [DragHandle](https://tiptap.dev/docs/v2/editor/extensions/functionality/drag-handle.md) extension for available editor commands.
