svg-tree-vue3

A Vue3 component for rendering tree in SVG.
1,259
Install
npm install svg-tree-vue3
Latest Version:0.5.10
Vue:3
Last Updated:Oct 24, 2025
Links: npm
Maintainer: pnpm-is-so-greate

SVG Tree Vue3

This is some simple SVG tree components for Vue3.

The demo page, which is also used for testing, is available.

Usage

Here is an example of how to use the component.

CSS Classes

  • node: The node element. Including the box and inner text.
  • link: The link element. The line from the parent node to the child node.
  • shadow: The shadow element. The shadow of the node.
  • extend: The extend element. The line from the node to the extend node and the extend node itself.
options

You can use both the options prop and CSS classes to customize the appearance of the tree.

// Default options in light mode
export const defaultLightColorOptions: ColorOptions = {
  // Stroke color of node borders and links.
  //
  // Could also be defined as:
  //
  // svg>rect, svg>path {
  //   stroke: gray;
  // }
  borderColor: "gray",
  // Fill color of nodes.
  //
  // Could also be defined as:
  //
  // svg>rect.node {
  //   fill: white;
  // }
  backgroundColor: "white",
  // Fill color of node shadows.
  //
  // Could also be defined as:
  //
  // svg>rect.shadow {
  //   fill: darkgray;
  // }
  shadowColor: "darkgray",
  // Fill color of texts.
  //
  // Could also be defined as:
  //
  // svg>text {
  //   fill: black;
  // }
  textColor: "black",
  textWeight: 400,
  // Fill color of texts when hovering.
  //
  // Could also be defined as:
  //
  // svg.hover>text {
  //   fill: black;
  // }
  textHoverColor: "darkcyan",
  textHoverWeight: 700,
  // Fill color of texts when active.
  //
  // Could also be defined as:
  //
  // svg.active>text {
  //   fill: black;
  // }
  textActiveColor: "darkcyan",
  textActiveWeight: 1000,
};

Related Packages

vue-jstree

a tree plugin for vue2

137,015 630
vue-svg-pan-zoom

Vue component for svg-pan-zoom

59,567
@jt-icons/icon-vue-components

Vue components of JT Icons collection.

2,961 1
@svgv/core

Node.js API to transform SVGs into Vue components.

1,525 4
vue-tree-list-new

A vue component for tree structure. Support adding treenode/leafnode, editing no...

902 1

Version History

Version Released Vue License
0.5.10 ^3.5.17
0.5.9 ^3.5.17
0.5.8 ^3.5.17
0.5.7 ^3.5.17
0.5.6 ^3.5.17