Articles in this section

How to Set Custom Tooltip for Nodes in React Diagram?

This article explains how to set a custom tooltip for nodes in React Diagram. In Syncfusion® React Diagram, tooltips provide additional information about diagram elements when hovering over or interacting with them. By default, tooltips display details such as size, position, and angle information while dragging, resizing, or rotating nodes and connectors. This article demonstrates how to customize the tooltip content for nodes and connectors in the diagram.

To customize the tooltip content for each node or connector, assign a value to the tooltip property.

Below is a code example illustrating how to display a custom tooltip with the employee’s name when hovering over an employee image node.

let nodes = [
 {
   id: 'node1',
   offsetX: 250, offsetY: 250,
   height: 100, width: 100,
   shape: {
     type: 'Image',
     source:
       'https://ej2.syncfusion.com/demos/src/diagram/employees/image16.png',
   },
   // Constraints to enable tooltip
   constraints: NodeConstraints.Default | NodeConstraints.Tooltip,
   // Set custom tooltip content
   tooltip: { content: 'John' }
 }
]; 

Refer to the working sample for additional details and implementation: Sample

Conclusion

We hope you enjoyed learning how to set custom tooltip for nodes in React Diagram.

You can refer to our React Diagram feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our React Diagram example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied