Skip to content

Tasks & Hierarchy

Each task in the tasks array maps to one row. Row order follows array order.

Required fields

FieldTypeDescription
idstringUnique identifier
namestringDisplay name
startDate | stringStart date/time
endDate | stringEnd date/time

Optional fields

FieldTypeDefaultDescription
progressnumber0Completion 0–100
parentIdstringParent task id (16px indent per level)
collapsedbooleanHide descendants when true
type'task' | 'milestone' | 'group''task'Row kind
showSummaryBarbooleantrueGroup summary bar on timeline
readOnlybooleanDisable drag, resize, progress edits
dependenciesstring[] | GanttDependency[]Predecessor ids
baseline{ start, end, color? }Original plan overlay
colorstringBar fill color
sticky'top' | 'bottom'Pin row while scrolling

Group rows

Set type: 'group' on parent rows for hierarchy and optional summary timeline bars.

showSummaryBarTimeline behavior
true (default)Summary bar with rolled-up dates/progress; child bars when expanded
falseNo bar on group row; children render their own bars

Parent rows with children show a ▸/▾ collapse button. Click toggles task.collapsed and updates via onTasksChange.

tsx
const tasks = [
  { id: 'phase', name: 'Phase 1', type: 'group', showSummaryBar: false, start: '2026-04-01', end: '2026-04-01' },
  { id: 'a', name: 'Task A', parentId: 'phase', start: '2026-04-02', end: '2026-04-06' },
  { id: 'envelope', name: 'Envelope', type: 'group', start: '2026-04-10', end: '2026-04-10' },
  { id: 'roof', name: 'Roofing', parentId: 'envelope', start: '2026-04-10', end: '2026-04-12' },
];

Milestones

tsx
{ id: 'm1', name: 'Go-live', type: 'milestone', start: '2026-06-01', end: '2026-06-01' }

Rendered as a 14px diamond with label to the right. Draggable (move only), no resize handles.

Dependencies

Add dependencies on the successor pointing to predecessor id(s). Finish-to-start (FS) only.

tsx
{ id: 'b', name: 'Task B', start: '...', end: '...', dependencies: ['task-a'] }

Baseline

Show original plan dates as an amber overlay. Enable with showBaseline (default true).

tsx
{
  id: 't1',
  name: 'Foundation',
  start: '2026-04-05',
  end: '2026-04-12',
  baseline: { start: '2026-04-01', end: '2026-04-10', color: '#e6a23c' },
}

See also: Group Summary example · Advanced example

Released under the MIT License.