Tooltip component wraps the Gantt component and displays a floating tooltip when the user hovers over a task bar. You can use the built-in tooltip or supply a custom Svelte component for the tooltip content.
Import
Basic usage
Wrap theGantt component with Tooltip:
Props
The Gantt API object. Obtain it by binding
this on the Gantt component. The tooltip uses this reference to look up task data when the user hovers over a bar.A custom Svelte component used to render the tooltip body. When omitted, the built-in tooltip design is used.The component receives a single
data prop of type ITask — the task currently being hovered.The
Gantt component to wrap. The tooltip attaches its hover listener to the content inside this slot.Custom tooltip content
Create a Svelte component that acceptsdata as a prop:
content prop:
The custom content component receives
data as a reactive prop. The component mounts and unmounts with the tooltip, so you do not need to guard against null in the surrounding template — but the {#if data} guard shown above is still good practice.