How to Create a Custom CSS Tooltip on Node Hover in OrgChart JS

How to Create a Custom CSS Tooltip on Node Hover in OrgChart JS

How to Create a Custom CSS Tooltip on Node Hover in OrgChart JS: How to Create a Custom CSS Tooltip on Node Hover in OrgChart JS (Full Guide + Code)

How to Create a Custom CSS Tooltip on Node Hover in OrgChart JS (Full Guide + Code)

If you want to enhance the user experience in your OrgChart JS charts, adding CSS-driven tooltips is one of the most effective improvements. Tooltips allow users to quickly view additional node information—such as a job title, description, or metadata—without cluttering the node design.

Full code example

In this tutorial, we’ll show you step-by-step how to build a beautiful animated CSS tooltip that appears when hovering over any node in OrgChart JS.

This approach gives you:

  • Fully custom tooltip styling

  • Smooth animations

  • Precise positioning

  • No modification to OrgChart templates

  • Works with any OrgChart JS theme or custom template

Let’s get started.


Why Use Custom CSS Tooltips in OrgChart JS?

OrgChart JS provides built-in templates and field bindings, but a custom tooltip gives you:

✔ Better branding

Match your company’s colors, fonts, and style.

✔ More flexibility

Tooltips can show long text, HTML, or dynamic content.

✔ Improved usability

Users often need quick details without opening a full node dialog.


Step 1: Create a Tooltip Container

The tooltip sits outside the chart and is positioned dynamically.

<div id="tooltip" class="chart-menu">
    <div class="tooltip tooltip-west">
        <span class="tooltip-content"></span>
    </div>
</div>
<div id="tree"></div>

This structure supports complex CSS animation and arrow styling.


Step 2: Initialize OrgChart JS and Bind Tooltip Content

We use the tooltip field inside the node data:

var chart = new OrgChart(document.getElementById('tree'), {
    template: 'ana',
    nodeBinding: {
        tooltip: 'tooltip'
    }
});

Load sample nodes:

chart.load([
    { id: 0, name: "node0", tooltip: 'At vero eos et accusamus et iusto odio' },
    { id: 1, name: "node1", pid: 0, tooltip: 'Lorem ipsum dolor sit amet...' },
    { id: 2, name: "node2", pid: 0, tooltip: 'Sed ut perspiciatis unde omnis...' },
    ...
]);

Each node now has custom tooltip text.


Step 3: Add Hover Events on Nodes

OrgChart JS renders nodes as SVG elements, so we detect hover using the redraw event.

The following code:

  • Finds all nodes

  • Detects mouseover and mouseleave

  • Reads the tooltip field

  • Uses OrgChart._menuPosition() to calculate exact coordinates

chart.on('redraw', function (sender) {
    var fieldElements = sender.element.querySelectorAll('[data-n-id]');
    for (var i = 0; i < fieldElements.length; i++) {
        var fieldElement = fieldElements[i];
        fieldElement.addEventListener('mouseover', function () {
            var nodeElement = this;
            while (!nodeElement.hasAttribute('data-n-id')) {
                nodeElement = nodeElement.parentNode;
            }
            var id = nodeElement.getAttribute('data-n-id');
            var tooltip = document.getElementById("tooltip");
            var tooltipContent = document.querySelector(".tooltip-content");

            var position = OrgChart._menuPosition(this, tooltip, sender.getSvg());
            tooltipContent.innerHTML = sender.get(id).tooltip;

            tooltip.style.left = position.x + 250 + "px";
            tooltip.style.top = position.y + "px";

            tooltip.classList.add("visible");
        });

        fieldElement.addEventListener('mouseleave', function () {
            var tooltip = document.getElementById("tooltip");
            if (tooltip) {
                tooltip.classList.remove('visible');
            }
        });
    }
});

This gives you a fully dynamic tooltip tied to the hovered node.


Step 4: Add CSS for the Tooltip Animation

Here is the full CSS used for this example.
It includes:

  • Smooth opacity transitions

  • 3D rotation animation

  • Tooltip arrow

  • West/east variants

  • Font and color configuration

html, body{
  width: 100%;
  height: 100%;
  padding: 0;
  margin:0;
  overflow: hidden;
  font-family: Helvetica;
}

#tree{
  width:100%;
  height:100%;
}

.tooltip {
    position: absolute;
    z-index: 999;
    width: 2.2em;
    height: 2.2em;
    cursor: pointer;
}

/* Tooltip bubble */

.tooltip-content {
    position: absolute;
    background: #F57C00;
    z-index: 9999;
    width: 200px;
    bottom: 50%;
    margin-bottom: -1em;
    padding: 20px;
    border-radius: 20px;
    font-size: 1.1em;
    text-align: center;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.tooltip-west .tooltip-content {
    left: 33px;
    transform-origin: -2em 50%;
    transform: translate3d(0,50%,0) rotate3d(1,1,1,30deg);
}

.visible .tooltip .tooltip-content {
    opacity: 1;
    transform: translate3d(0,50%,0) rotate3d(0,0,0,0);
    pointer-events: auto;
}

/* Tooltip arrow */

.tooltip-content::after {
    content: '';
    position: absolute;
    width: 2em;
    height: 2em;
    top: 50%;
    margin-top: -1em;
    background: url(https://balkan.app/OrgChartJS-Demos/customTemplateTooltip.svg)
        no-repeat center;
    background-size: 100%;
}

.tooltip-west .tooltip-content::after {
    right: 99%;
}

The result is a smooth, animated tooltip that feels native to the OrgChart experience.


Final Result

After following these steps, you now have:

✔ A custom CSS tooltip

✔ Triggered on node hover

✔ Dynamic positioning based on node location

✔ Full styling control

✔ Works with any OrgChart JS template

This method is ideal for showing:

  • Job descriptions

  • Department details

  • Employee notes

  • Contact information

  • Extra metadata


Tooltip on node hover with OrgChart JS

Conclusion

Adding a CSS tooltip to OrgChart JS is a powerful way to improve usability without modifying your node template. With just a bit of JavaScript and CSS, you can create professional, animated tooltips that deliver richer information to your users.

If you want to go deeper, consider:

  • HTML-rich tooltips

  • Tooltips with images or icons

  • Tooltips triggered by custom buttons inside nodes

  • Mobile-friendly long-press activation

Want help building a custom OrgChart JS feature?
Just ask!

Improved Slink Positioning in OrgChart JS

Show initials in OrgChart JS

Implementing Custom Auth for Server JS

OrgChart JS Controls

File-Like Structure with OrgChart JS

Update Alert: New twix template and cleaner connections

OrgChart JS Mobile Support Is Live

OrgChart JS Mobile View

OrgChart JS: Always First, Always Innovating

Introducing Tree List: A New Way to Visualize Hierarchies in 2026

Build and Share Org Charts Easily — Meet the Free OrgChart App by BALKAN App

Meet OrgChart App - Your New Way to Build and Share Org Charts

OrgChart PDF Cover Page

Minimize and Maximize nodes in OrgChart JS

Copy an OrgChart to Clipboard

Copy OrgChart Data to Clipboard

Pan on Node Is Now the Default in OrgChart JS

Export 2 Charts in a Single PDF

Introducing Liquid Glass Buttons in OrgChart JS

OrgScribe: The Markdown-Style Way to Build Org Charts

Achieve Any OrgChart Design

Why Not Load on Demand in OrgChart JS

JSON Export Slinks with Nodes in OrgChart JS

OrgChart JS Privacy

GEDCOM in Family Tree JS 2

Update a JSON File with Family Tree Members

Hide Nodes in an OrgChart with CSS

Pin (set as root) a node in an OrgChart

WordPress OrgChart Plugin

Family Tree in WordPress

Organizational Charts with Multiple Parents

Introducing new PDF and PNG Previews in OrgChart JS

Building an Org Chart MVP

Introducing PowerPoint Preview in OrgChart JS

Change The Order in the OrgChart by Drag and Drop (Simple Example)

Highlight to the root on search in OrgChart JS

OrgChart JS Now Supports Export to PowerPoint

OrgChart JS Now Supports Export to PowerPoint

Dynamically changing an orgchart field

Project Timeline Chart

OrgChart Conditional Node Size

Add CSS on Export in OrgChart JS

OrgChart JS Angular Templates

Org Chart Web App with Node.js and Express

Loading on Demand with Family Tree JS 2

Dynamic Colors Organizational Chart

Charlie Chaplin Family Tree

Introducing Family Tree JS 2: The Next Generation is Here!

React OrgChart

Create and run an OrgChart Single Page Application with Node.js – beginner's guide.

Export and Import Org Chart to Excel

Adding Custom HTML Elements into OrgChart JS container

Еasily Create a Template in an OrgChart

Node Swapping in an Organizational Chart

Vladimir Putin Family Tree

Add Field Data in Expand button with OrgChart JS

Bill Gates Family Tree

Create a Tooltip for a ForeignObject Element Hover in OrgChart JS

Custom Aligning Nodes in a JavaScript Organizational Chart

Center and Zoom on Search Click in OrgChart JS

Create Multiline Group Titles in OrgChart JS

Adding Arrows in OrgChart JS Links

Show a Custom Edit Form for a node in OrgChart JS

Jeff Bezos Family Tree

How to Add Material Icons in OrgChart JS

Leonardo DiCaprio Family Tree

Visualizing Dual Reporting Structures with OrgChart JS

Exporting OrgChart JS to A4 PDF: A Step-by-Step Guide

Genghis Khan Family Tree: The Lineage of the Great Khan

OrgChart JS now support Export to Visio

New Export Option: childLevels in OrgChart JS

Elon Musk Family Tree

AI for OrgChart JS: Revolutionizing Organization Charts

Family Tree JS 2 (Preview)

d3 org chart

Our Family Tree App is Now on Android!

Why BALKAN OrgChart JS is the Best Organizational Chart Library

How to Create a JavaScript Flow Chart

How to Add an Organizational Chart to a Mobile Application

How to Create a JavaScript Organizational Chart

OrgChart JS Now Supports PDF Export Per Team

Introducing Family Tree App

Donald Trump Family Tree

Discover Your Roots: Build Your Family Tree with BALKAN App

JavaScript Organization Chart

Instantly create interactive, intuitive flowcharts in seconds

JavaScript Hierarchy Chart

Mermaid js alternative

Create Flowcharts in Seconds with Flow Chart JS: Your New Favorite JavaScript Library

Customizing Filter UI - Code of The Week

Zoom Slider - Code of The Week

Bookmarks - Code of The Week

Customizing Search Results - Code of The Week

Introducing Undo Redo - Code Of The Week

Price adjustment announcement

The price will increase for new customers

Buttons for adding family members to a family tree - Code of The Week

Levels - Code of The Week

Change node color from a button in the Edit Form - Code of The Week

Filter and Highlight Nodes - Code of The Week

Up Expanding - Code Of The Week

Programmatically move the chart - Code of The Week

Siblings in Family Tree JS - Code of The Week

Purple template - Code of The Week

Assistant With Children - Code of The Week

Conditional Layout - Code of The Week

Conditional Color - Code of the Week

Sriniz Family Tree Template - Code of The Week

Color Picker - Code of The Week

Add company logo as watermark in exported PDF documents - Code of The Week

Mind map - Code of The Week

Create relationship with circle menu - Code of The Week

Animated Photos - Code of the Week

Grouped Dotted Lines - Code Of The Week

Dotted Lines - Code Of The Week

Department Dynamic Title - Code Of The Week

Add expand button for partners - Code of the Week

Change the sub levels with Drag and Drop - Code of The Week

Custom Edit From using Popover - Code of the Week

Sub levels tag option - Code of the Week

Highlights search results directly on Org Chart nodes - Code of the Week

Code of the Week/Relationship maps and Business process diagrams

Search using field name abbreviations - Code of the Week

Dynamic Template - Code of the Week

Read and Write local CSV file using File API and Org Chart JS - Code of The Week

Organizational Chart Path Highlighting and Selection

Modern Template - Org Chart JS

Performance - Org Chart JS

Single parent is supported in Family Tree JS

How To Develop a Flowchart Maker with Org Chart JS

How to upload a photo to Family Tree JS in .NET core

How to change the color of selected node - Family Tree JS

Family Tree with live tiles

Error

BALKAN Blog

The Latest BALKAN App News and Releases. Latest information on Org Chart JS and Family Tree JS.