Skip to content
GitHub
API reference

Tasks & dependencies

Task dates, hierarchy, baseline plans, and scheduling links.

Usage

import type { GanttTask, TaskDependency } from "@art-tools/react-gantt";

const tasks: GanttTask[] = [
  { id: "design", name: "Design", startDate: new Date(2026, 0, 5), duration: 3 },
  { id: "build", name: "Build", startDate: new Date(2026, 0, 8), duration: 5 },
];

const dependencies: TaskDependency[] = [
  { from: "design", to: "build", type: "FS", lag: 0 },
];
  • endDate is exclusive: a Monday-through-Friday task ends at Saturday 00:00. An explicit endDate takes precedence over duration. Milestones and zero-duration tasks represent instants.
  • duration uses the chart's durationUnit, which defaults to day. The library derives dates from duration and does not rewrite the input duration field. progress is a percentage from 0 to 100.
  • type defaults to task. Use milestone for an instant and summary for a parent whose dates and progress roll up from children. parentId links a child to its parent; omit it or use null for a root.
  • Baselines are consumer-owned snapshots. Only the first five entries per task are considered for display. Their endDate is required for tasks and summaries and omitted for milestones. baselineLayout defaults to height 4px, padding 1px, and gap 2px.
  • Dependency from/to values are task IDs. FS means finish-to-start, SS start-to-start, FF finish-to-finish, and SF start-to-finish. lag uses durationUnit and counts working time when a calendar is supplied.
GanttTask documented properties
PropertyType & description
idRequiredId
nameRequiredstring
startDateRequiredDate
endDateOptionalDate
durationOptionalnumber
progressOptionalnumber
typeOptionalGanttTaskType
parentIdOptionalId | null
baselinesOptionalGanttBaseline[]

Ordered plans; only the first five entries are considered for display.

TypeScript declaration
export declare interface GanttTask {
    id: Id;
    name: string;
    startDate: Date;
    endDate?: Date;
    duration?: number;
    progress?: number;
    type?: GanttTaskType;
    parentId?: Id | null;
    /** Ordered plans; only the first five entries are considered for display. */
    baselines?: GanttBaseline[];
}
Supporting types

These types appear in this signature but are not separate package exports.

declare type GanttTaskType = "task" | "milestone" | "summary";

Id

Type
export declare type Id = string | number;

Consumer-owned planned span. `endDate` is exclusive; milestones use only `startDate`.

GanttBaseline documented properties
PropertyType & description
idRequiredId

Unique within one task.

titleOptionalstring
startDateRequiredDate
endDateOptionalDate

Required for tasks and summaries, omitted for milestones.

TypeScript declaration
/** Consumer-owned planned span. `endDate` is exclusive; milestones use only `startDate`. */
export declare interface GanttBaseline {
    /** Unique within one task. */
    id: Id;
    title?: string;
    startDate: Date;
    /** Required for tasks and summaries, omitted for milestones. */
    endDate?: Date;
}
TaskDependency documented properties
PropertyType & description
fromRequiredId
toRequiredId
typeRequiredTaskDependencyType
lagOptionalnumber
TypeScript declaration
export declare type TaskDependency = {
    from: Id;
    to: Id;
    type: TaskDependencyType;
    lag?: number;
};
export declare type TaskDependencyType = "FS" | "FF" | "SS" | "SF";

Related examples