Skip to content

vue3-tree-vueInteractive tree views for Vue 3

A flexible, recursive tree-view component — checkboxes, drag & drop, lazy loading, slots and more. Every example below is live and editable.

Install

bash
npm i vue3-tree-vue

Expand & Collapse

What to look for

Click any folder to expand or collapse it. Notice that the Movies node renders two custom icons (🎬🍿) through the item-prepend-icon slot, while every other node falls back to its own single icon — the same slot can give one node bespoke content.

Event console
Interact with the tree to see emitted events…

Checkable Items

Set isCheckable to get checkboxes. Checking a parent cascades to its children, and partially-checked parents render an indeterminate (tri-state) box.

Event console
Interact with the tree to see emitted events…

Drag & Drop

Drag a file onto a folder to move it. The async dropValidator callback decides which drops are allowed.

What to look for

Drag a file onto a folder to re-parent it — the async dropValidator(dropped, host) runs first and must resolve true for the move to happen. The Operating System Files (Read-only) folder is fully locked:

  • it refuses incoming files — the validator returns false for read-only folders,
  • the folder itself can't be moved into another folder — it sets disableDragAndDrop: true, and
  • none of its files can be moved out either — each one sets disableDragAndDrop: true too.

Watch the event console to see each move — and each refusal.

Event console
Interact with the tree to see emitted events…

Context Menu

Right-click any file to fire the onContextMenu event and drive your own menu — payload is { item, event }.

Event console
Interact with the tree to see emitted events…

Ready to build your own? Head to Getting Started or browse the API reference.

Released under the MIT License.