Skip to content

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' },
],
},
};

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:

FieldTooltip output
summaryTask name and completion percent, for example Design - 50%.
nameTask name.
percentDoneCompletion percent.
taskTypeHuman-readable task type.
statusHuman-readable task status.
startDateScheduled start date, formatted with gantt.dateFormats.tooltip.
endDateScheduled end date, formatted with gantt.dateFormats.tooltip.
durationFormatted task duration in its retained or project-selected unit.
taskModeAuto Scheduled or Manually Scheduled.
schedulingWarningsScheduling warnings joined into one line; skipped when empty.
costFormatted task cost; skipped when empty.
assigneesComma-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.

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,
}

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;
},
};