npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-kite-tree

v1.0.2

Published

Lightweight tree graph component for Vue 3 (HTML + SVG hybrid)

Readme

Vue Kite Tree Chart

A lightweight and flexible tree graph component for Vue 3 that combines HTML nodes with SVG connectors. Perfect for organizational charts, hierarchy visualizations, and tree structures.

✨ Features

  • 🚀 Lightweight - Minimal bundle size with zero external dependencies (only Vue 3)
  • 🎨 Customizable - Flexible styling with TailwindCSS support
  • 📱 Responsive - Adapts to different screen sizes
  • Performant - Optimized rendering with SVG path caching
  • 🔧 Flexible - Custom node templates via slots
  • 🌳 Smart Layout - Automatic tree positioning with rounded SVG connectors
  • 🔍 Zoom & Pan - Cursor-anchored zoom and smooth pan navigation
  • 🎯 Interactive - Mouse wheel zoom and drag-to-pan viewport
  • Standalone - No Pinia or external state management required

📦 Installation

npm install vue-kite-tree

🚀 Quick Start

Method 1: With CSS Import (Recommended)

<template>
  <KiteTree :data="orgData" />
</template>

<script setup>
import { KiteTree } from 'vue-kite-tree'
import 'vue-kite-tree/style.css'

const orgData = {
  id: 1,
  label: 'CEO',
  children: [
    {
      id: 2,
      label: 'CTO',
      children: [
        { id: 4, label: 'Frontend', children: [] },
        { id: 5, label: 'Backend', children: [] }
      ]
    },
    {
      id: 3,
      label: 'CFO',
      children: []
    }
  ]
}
</script>

Method 2: Manual CSS Setup

If you prefer to use your own TailwindCSS setup:

<template>
  <KiteTree :data="orgData" />
</template>

<script setup>
import { KiteTree } from 'vue-kite-tree'

const orgData = {
  // ... same data structure
}
</script>

Note: Make sure you have TailwindCSS configured in your project for proper styling.

📖 API Reference

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | data | Object | Required | Tree data structure with id, label, and children | | lineColor | String | '#9ca3af' | Color of connecting lines | | lineWidth | Number | 1.5 | Width of connecting lines | | radius | Number | 8 | Corner radius for curved connections | | onNodeUpdate | Function | () => {} | Callback when tree data changes (optional) |

Data Structure

{
  id: Number,           // Unique identifier
  label: String,        // Display text
  children: Array       // Child nodes (recursive)
}

🎨 Customization

Custom Node Styling

<template>
  <KiteTree :data="data">
    <template #node="{ node }">
      <div class="custom-node">
        <div class="node-icon">👤</div>
        <div class="node-label">{{ node.label }}</div>
        <div class="node-meta">{{ node.children.length }} reports</div>
      </div>
    </template>
  </KiteTree>
</template>

<style>
.custom-node {
  @apply bg-blue-500 text-white rounded-lg p-3 shadow-lg;
}
</style>

Custom Line Styling

<template>
  <KiteTree 
    :data="data" 
    line-color="#3b82f6"
    :line-width="2"
    :radius="12"
  />
</template>

🔧 Advanced Usage

Interactive Zoom & Pan

The component includes built-in zoom and pan functionality:

  • Mouse Wheel - Zoom in/out at cursor position
  • Drag - Pan the viewport by dragging empty space
  • Buttons - Use + / - / Reset buttons for control
<template>
  <div class="w-full h-screen">
    <KiteTree :data="treeData" />
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { KiteTree } from 'vue-kite-tree'
import 'vue-kite-tree/style.css'

const treeData = ref({
  id: 1,
  label: 'CEO',
  children: [
    {
      id: 2,
      label: 'CTO',
      children: [
        { id: 4, label: 'Frontend', children: [] },
        { id: 5, label: 'Backend', children: [] }
      ]
    },
    {
      id: 3,
      label: 'CFO',
      children: [
        { id: 6, label: 'Marketing', children: [] }
      ]
    }
  ]
})
</script>

Dynamic Data Updates

<template>
  <div class="w-full h-screen">
    <KiteTree :data="treeData" />
    <button @click="addNode" class="absolute bottom-4 right-4 px-4 py-2 bg-blue-500 text-white rounded">
      Add Node
    </button>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { KiteTree } from 'vue-kite-tree'
import 'vue-kite-tree/style.css'

const treeData = ref({
  id: 1,
  label: 'Root',
  children: []
})

function addNode() {
  const newId = Date.now()
  treeData.value.children.push({
    id: newId,
    label: `Node ${newId}`,
    children: []
  })
}
</script>

Integration with External State

<template>
  <KiteTree :data="orgStore.hierarchy" />
</template>

<script setup>
import { useOrgStore } from '@/stores/org'
import { KiteTree } from 'vue-kite-tree'
import 'vue-kite-tree/style.css'

const orgStore = useOrgStore()
</script>

🎯 Use Cases

  • Organizational Charts - Company hierarchies and team structures
  • Decision Trees - Flow diagrams and decision paths
  • File Systems - Directory and file explorers
  • Category Trees - Product categories and taxonomies
  • Family Trees - Genealogy visualizations
  • Mind Maps - Idea and concept relationships

🎯 Interactive Features

Zoom & Navigation

  • Cursor-Anchored Zoom - Zoom centers on mouse cursor position (like Google Maps)
  • Mouse Wheel - Smooth zoom in/out with configurable step
  • Click Controls - Zoom in/out buttons with reset option
  • Pan Navigation - Drag empty space to move viewport
  • Scale Limits - Min 0.4x, Max 2.5x zoom levels

Component State

  • Local State - Each KiteTree component has its own isolated state
  • Reactive UI - All components respond to state changes
  • No External Dependencies - Pure Vue 3 Composition API, no Pinia required