Task Tooltips
Hover over a task bar to see the task name, dates, and progress labeled Complete.
Use taskTooltipFields when you only need to choose which built-in fields appear in task-bar tooltips:
grid.gantt = { ...project, visuals: { taskTooltipFields: [ 'name', 'startDate', 'endDate', { field: 'percentDone', label: 'Complete' }, ], },};Task tooltip API
Section titled “Task tooltip API”taskTooltipFields is an ordered array. Each entry can be a field id string or an object with a field and optional label:
type GanttTaskTooltipField = | GanttTaskTooltipFieldId | { field: GanttTaskTooltipFieldId; label?: string };Object entries let you rename a built-in line. Set label: '' to render only the value without a Label: prefix.
visuals: { taskTooltipFields: [ { field: 'name', label: '' }, { field: 'percentDone', label: 'Done' }, ],}Supported built-in fields:
| Field | Tooltip output |
|---|---|
summary | Task name and completion percent, for example Design - 50%. |
name | Task name. |
percentDone | Completion percent. |
taskType | Human-readable task type. |
status | Human-readable task status. |
startDate | Scheduled start date, formatted with gantt.dateFormats.tooltip. |
endDate | Scheduled end date, formatted with gantt.dateFormats.tooltip. |
duration | Formatted task duration in its retained or project-selected unit. |
taskMode | Auto Scheduled or Manually Scheduled. |
schedulingWarnings | Scheduling warnings joined into one line; skipped when empty. |
cost | Formatted task cost; skipped when empty. |
assignees | Comma-separated assignee names; skipped when empty. |
When taskTooltipFields is omitted, Gantt keeps the default tooltip: summary, taskType, status, startDate, endDate, duration, taskMode, schedulingWarnings, cost, and assignees. An empty array intentionally renders an empty tooltip.
taskTooltipHook has priority over taskTooltipFields and can replace the whole tooltip string:
visuals: { taskTooltipFields: ['name'], taskTooltipHook: ({ row }) => `${row.name}\n${row.status}`,}Return null or undefined from taskTooltipHook to fall back to taskTooltipFields or the default tooltip. Use the hook for custom row metadata that is not part of the built-in field list.
Interaction and offscreen tooltips
Section titled “Interaction and offscreen tooltips”Use interactionTooltipHook for the move and resize readout. It receives the proposed dates, the interaction kind, and the default structured content. Return a string, a DOM node, or a structured tooltip to replace it. Return false to hide it, or undefined to keep the default. offscreenTaskTooltipHook controls the text on the buttons that reveal offscreen tasks.
visuals: { interactionTooltipHook: ({ kind, startDate, endDate }) => kind === 'resize' ? `${startDate} – ${endDate}` : undefined, offscreenTaskTooltipHook: ({ row, defaultTooltip }) => row.name === 'Release' ? 'Go to release' : defaultTooltip,}Flag tooltips
Section titled “Flag tooltips”Timeline flags show their label and date by default. Set a flag’s tooltip to your own text, or to false to disable its tooltip.
visuals: { milestoneLines: [ { id: 'release', date: '2026-04-10', label: 'Release', tooltip: 'Production release' }, ],}To render your own DOM content for a flag, use the grid’s tooltip.renderContent callback. Return undefined for other targets so they keep their default tooltips. The same callback can customize task-bar, dependency, and offscreen button tooltip content.
grid.tooltip = { renderContent: ({ target, document }) => { if (!target?.closest('[data-gantt-flag-id="release"]')) return undefined; const content = document.createElement('strong'); content.textContent = 'Production release'; return content; },};