GanttChart

This component is an extended version of the gantt-task-react library. It is ideal for visualizing project timelines, tasks, and milestones with enhanced customization options.

Example

Example usage

API

GanttChart
PropDescriptionTypeDefault
tasksAn array of tasks to be displayed in the Gantt chart. Each task includes properties like id, name, start, end, and progress.ExtendedTask[][]
viewModeThe view mode of the Gantt chart. Can be set to Hour, Quarter Day, Half Day, Day, Week, Month, or Year.ViewModeViewMode.Day
extraColumnsAn array of objects defining additional columns to be displayed in the task list. Each object contains a header and a cell renderer.{ header: ExtraHeader; cell: ExtraCell }[][]
colorsMapA mapping of custom colors to task types or specific tasks. This allows for dynamic styling based on the task or project type.Object{string, string}{}
showArrowA flag to determine whether to display dependency arrows between tasks. When set to false, arrows are hidden.booleantrue
headerHeightThe height of the header in the Gantt chart, in pixels.number50
columnWidthThe width of each column in the Gantt chart, in pixels.number65
rowHeightThe height of each row in the Gantt chart, in pixels.number50
barCornerRadiusThe corner radius of the task bars in the Gantt chart.number6
TaskListHeaderA custom header component for the task list. Allows for the inclusion of additional headers defined in extraColumns.{ headerHeight: number; rowWidth: string; fontFamily: string; fontSize: string; }TaskListHeader
TaskListTableA custom table component for the task list, allowing the inclusion of additional cells defined in extraColumns.{ rowHeight: number; rowWidth: string; fontFamily: string; fontSize: string; locale: string; tasks: Task[]; selectedTaskId: string; setSelectedTask: (taskId: string) => void; onExpanderClick: (task: Task) => void; }TaskListTable
TooltipContentA custom tooltip component for displaying task details.{ task: Task; fontSize: string; fontFamily: string; }TooltipContent
todayColorThe color used to highlight the current day in the Gantt chart.stringurl(#horzLines)
arrowColorThe color of the dependency arrows between tasks.string#3380fa
onSelectCallback invoked when a task is selected or unselected.(task: Task, isSelected: boolean) => voidundefined
onDoubleClickCallback invoked when a task is double-clicked.(task: Task) => voidundefined
onClickCallback invoked when a task is clicked.(task: Task) => voidundefined
onDateChangeCallback invoked when the start or end date of a task changes. Returning false or throwing an error will undo the operation.(task: Task, children: Task[]) => void | boolean | Promise | Promiseundefined
onProgressChangeCallback invoked when the progress of a task changes. Returning false or throwing an error will undo the operation.(task: Task, children: Task[]) => void | boolean | Promise | Promiseundefined
onDeleteCallback invoked when a task is deleted. Returning false or throwing an error will undo the operation.(task: Task) => void | boolean | Promise | Promiseundefined
onExpanderClickCallback invoked when the expander icon is clicked in the task list.(task: Task) => voidundefined

Dependencies

gantt-task-react

You can found all the available props here gantt-task-react