Fluxo UIFluxo UIv0.6.2

Gantt Chart

A full-featured project timeline component with drag & drop, hierarchical tasks, dependencies, multiple view modes, and rich customization.

Basic Usage

A minimal Gantt chart with default columns. Tasks auto-scroll to today on mount.

Basic Gantt Chart

Task Name
Project Kickoff
Requirements Gathering
UI Design
Backend Development
Testing & QA
Deployment
November 2026
December 2026
12Thu
13Fri
14Sat
15Sun
16Mon
17Tue
18Wed
19Thu
20Fri
21Sat
22Sun
23Mon
24Tue
25Wed
26Thu
27Fri
28Sat
29Sun
30Mon
1Tue
2Wed
3Thu
4Fri
5Sat
6Sun
7Mon
8Tue
9Wed
10Thu
11Fri
12Sat
13Sun
14Mon
15Tue
16Wed
17Thu
18Fri
19Sat
20Sun
21Mon
22Tue
23Wed
Project Kickoff
Requirements Gathering
UI Design
Backend Development
Testing & QA
Deployment
Basic Example
import { GanttChart } from 'fluxo-ui';
import type { GanttTask } from 'fluxo-ui';

const tasks: GanttTask[] = [
  {
    id: '1',
    name: 'Requirements Gathering',
    start: new Date('2025-01-01'),
    end: new Date('2025-01-07'),
    progress: 100,
    assignee: 'Alice',
  },
  {
    id: '2',
    name: 'UI Design',
    start: new Date('2025-01-06'),
    end: new Date('2025-01-14'),
    progress: 60,
    color: '#8b5cf6',
    assignee: 'Bob',
  },
  // ...
];

function MyPage() {
  return <GanttChart tasks={tasks} height={400} />;
}

View Modes

Switch between Day, Week, Month, Quarter, and Year views. Can be controlled externally or left to the built-in toolbar.

Controlled View Mode

Task Name
Project Kickoff
Requirements Gathering
UI Design
Backend Development
Testing & QA
Deployment
November 2026
December 2026
12Thu
13Fri
14Sat
15Sun
16Mon
17Tue
18Wed
19Thu
20Fri
21Sat
22Sun
23Mon
24Tue
25Wed
26Thu
27Fri
28Sat
29Sun
30Mon
1Tue
2Wed
3Thu
4Fri
5Sat
6Sun
7Mon
8Tue
9Wed
10Thu
11Fri
12Sat
13Sun
14Mon
15Tue
16Wed
17Thu
18Fri
19Sat
20Sun
21Mon
22Tue
23Wed
Project Kickoff
Requirements Gathering
UI Design
Backend Development
Testing & QA
Deployment
const [viewMode, setViewMode] = useState<GanttViewMode>('day');

<GanttChart
  tasks={tasks}
  height={400}
  viewMode={viewMode}
  onViewModeChange={setViewMode}
/>

Hierarchical Tasks & Milestones

Nest child tasks inside a parent using the children array. Use type: 'group' for summary bars and type: 'milestone' for diamond markers. Groups can be collapsed.

Phases, Groups & Milestones

Task
Owner
Phase 1 — Discovery
Stakeholder Interviews
Alice
Market Research
Bob
Competitive Analysis
Carol
Phase 2 — Design
Wireframes
Dave
Visual Design
Eve
Prototyping
Alice
Phase 3 — Development
Design Review
Launch
November 2026
December 2026
January 2027
7Sat
8Sun
9Mon
10Tue
11Wed
12Thu
13Fri
14Sat
15Sun
16Mon
17Tue
18Wed
19Thu
20Fri
21Sat
22Sun
23Mon
24Tue
25Wed
26Thu
27Fri
28Sat
29Sun
30Mon
1Tue
2Wed
3Thu
4Fri
5Sat
6Sun
7Mon
8Tue
9Wed
10Thu
11Fri
12Sat
13Sun
14Mon
15Tue
16Wed
17Thu
18Fri
19Sat
20Sun
21Mon
22Tue
23Wed
24Thu
25Fri
26Sat
27Sun
28Mon
29Tue
30Wed
31Thu
1Fri
2Sat
3Sun
4Mon
5Tue
Phase 1 — Discovery
Stakeholder Interviews
Market Research
Competitive Analysis
Phase 2 — Design
Wireframes
Visual Design
Prototyping
Phase 3 — Development
const tasks: GanttTask[] = [
  {
    id: 'phase-1',
    name: 'Phase 1 — Discovery',
    type: 'group',
    start: new Date('2025-01-01'),
    end: new Date('2025-01-14'),
    progress: 90,
    children: [
      { id: 'p1-t1', name: 'Stakeholder Interviews', start: '2025-01-01', end: '2025-01-05', progress: 100 },
      { id: 'p1-t2', name: 'Market Research',        start: '2025-01-03', end: '2025-01-10', progress: 80 },
    ],
  },
  {
    id: 'milestone-1',
    name: 'Design Review',
    type: 'milestone',
    start: new Date('2025-01-14'),
    end: new Date('2025-01-14'),
    color: '#f59e0b',
  },
];

<GanttChart tasks={tasks} height={400} />

Task Dependencies

Connect tasks with dependency arrows using four relationship types: Finish-to-Start, Start-to-Start, Finish-to-Finish, and Start-to-Finish.

Dependency Arrows

Task
Analysis
Design
Development
Parallel Task A
Parallel Task B
Testing
November 2026
December 2026
9Mon
10Tue
11Wed
12Thu
13Fri
14Sat
15Sun
16Mon
17Tue
18Wed
19Thu
20Fri
21Sat
22Sun
23Mon
24Tue
25Wed
26Thu
27Fri
28Sat
29Sun
30Mon
1Tue
2Wed
3Thu
4Fri
5Sat
6Sun
7Mon
8Tue
9Wed
10Thu
11Fri
12Sat
13Sun
14Mon
15Tue
16Wed
17Thu
18Fri
19Sat
20Sun
21Mon
22Tue
23Wed
Analysis
Design
Development
Parallel Task A
Parallel Task B
Testing
const tasks: GanttTask[] = [
  {
    id: 'analysis',
    name: 'Analysis',
    start: '2025-01-01',
    end: '2025-01-07',
    progress: 100,
  },
  {
    id: 'design',
    name: 'Design',
    start: '2025-01-08',
    end: '2025-01-14',
    progress: 60,
    dependencies: [{ targetId: 'analysis', type: 'finish-to-start' }],
  },
  {
    id: 'dev',
    name: 'Development',
    start: '2025-01-15',
    end: '2025-01-28',
    progress: 0,
    dependencies: [{ targetId: 'design', type: 'finish-to-start' }],
  },
];

// Supported dependency types:
// 'finish-to-start' | 'start-to-start' | 'finish-to-finish' | 'start-to-finish'

Date Markers

Mark important dates (deadlines, releases) with labelled vertical lines and shade date ranges such as sprints with bands. Labels sit in a header row and are stacked when they collide. Overlapping bands get their own row, a band shows its shortLabel when the label does not fit, and the timeline widens to fill the panel (fillWidth).

Markers & Deadlines

Task Name
Project Kickoff
Requirements Gathering
UI Design
Backend Development
Testing & QA
Deployment
November 2026
December 2026
12Thu
13Fri
14Sat
15Sun
16Mon
17Tue
18Wed
19Thu
20Fri
21Sat
22Sun
23Mon
24Tue
25Wed
26Thu
27Fri
28Sat
29Sun
30Mon
1Tue
2Wed
3Thu
4Fri
5Sat
6Sun
7Mon
8Tue
9Wed
10Thu
11Fri
12Sat
13Sun
14Mon
15Tue
16Wed
17Thu
18Fri
19Sat
20Sun
21Mon
22Tue
23Wed
Sprint 12
Sprint 13
Sprint 14
Today
Sprint End
Release
Project Kickoff
Requirements Gathering
UI Design
Backend Development
Testing & QA
Deployment
import type { GanttBand, GanttMarker } from 'fluxo-ui';

const markers: GanttMarker[] = [
  { id: 'today',    date: new Date(),               label: 'Today',      color: '#3b82f6' },
  { id: 'sprint',   date: new Date('2025-02-07'),   label: 'Sprint End', color: '#f59e0b' },
  { id: 'release',  date: new Date('2025-02-28'),   label: 'Release',    color: '#10b981' },
];

const bands: GanttBand[] = [
  { id: 's12', start: '2025-01-27', end: '2025-02-07', label: 'Sprint 12', shortLabel: '12' },
  { id: 's13', start: '2025-02-10', end: '2025-02-21', label: 'Sprint 13', shortLabel: '13' },
];

<GanttChart tasks={tasks} markers={markers} bands={bands} height={400} />

Drag & Drop / Resize

Drag task bars to move them or drag either handle to resize. Changes are reported via onTaskChange.

Interactive — Drag to Move, Handles to Resize

Task Name
Project Kickoff
Requirements Gathering
UI Design
Backend Development
Testing & QA
Deployment
November 2026
December 2026
12Thu
13Fri
14Sat
15Sun
16Mon
17Tue
18Wed
19Thu
20Fri
21Sat
22Sun
23Mon
24Tue
25Wed
26Thu
27Fri
28Sat
29Sun
30Mon
1Tue
2Wed
3Thu
4Fri
5Sat
6Sun
7Mon
8Tue
9Wed
10Thu
11Fri
12Sat
13Sun
14Mon
15Tue
16Wed
17Thu
18Fri
19Sat
20Sun
21Mon
22Tue
23Wed
Project Kickoff
Requirements Gathering
UI Design
Backend Development
Testing & QA
Deployment
const [tasks, setTasks] = useState<GanttTask[]>(initialTasks);

const handleTaskChange = (e: GanttTaskChangeEvent) => {
  setTasks(prev =>
    prev.map(t => t.id === e.task.id
      ? { ...t, start: e.start, end: e.end }
      : t
    )
  );
};

<GanttChart
  tasks={tasks}
  height={400}
  allowTaskDrag={true}     // default
  allowTaskResize={true}   // default
  onTaskChange={handleTaskChange}
  onTaskClick={({ task }) => console.log('clicked', task.name)}
  onTaskDoubleClick={({ task }) => openEditModal(task)}
/>

Creating Tasks by Drawing

Enable allowTaskCreate and let users draw new tasks by clicking and dragging on empty row space.

Draw New Tasks (drag on empty area)

Task Name
Existing Task
November 2026
December 2026
14Sat
15Sun
16Mon
17Tue
18Wed
19Thu
20Fri
21Sat
22Sun
23Mon
24Tue
25Wed
26Thu
27Fri
28Sat
29Sun
30Mon
1Tue
2Wed
3Thu
4Fri
Existing Task
const [tasks, setTasks] = useState<GanttTask[]>(initialTasks);

const handleTaskCreate = (e: GanttTaskCreateEvent) => {
  const newTask: GanttTask = {
    id: `task-${Date.now()}`,
    name: 'New Task',
    start: e.start,
    end: e.end,
    progress: 0,
  };
  setTasks(prev => [...prev, newTask]);
};

<GanttChart
  tasks={tasks}
  height={400}
  allowTaskCreate={true}
  onTaskCreate={handleTaskCreate}
/>

Custom Columns

Define any number of columns with custom render templates. Access the full task object inside templates.

Custom Column Rendering

Task
Owner
%
Project Kickoff
A
100%
Requirements Gathering
B
80%
UI Design
C
40%
Backend Development
D
20%
Testing & QA
E
0%
Deployment
A
0%
November 2026
December 2026
12Thu
13Fri
14Sat
15Sun
16Mon
17Tue
18Wed
19Thu
20Fri
21Sat
22Sun
23Mon
24Tue
25Wed
26Thu
27Fri
28Sat
29Sun
30Mon
1Tue
2Wed
3Thu
4Fri
5Sat
6Sun
7Mon
8Tue
9Wed
10Thu
11Fri
12Sat
13Sun
14Mon
15Tue
16Wed
17Thu
18Fri
19Sat
20Sun
21Mon
22Tue
23Wed
Project Kickoff
Requirements Gathering
UI Design
Backend Development
Testing & QA
Deployment
import type { GanttColumn } from 'fluxo-ui';

const columns: GanttColumn[] = [
  { field: 'name', headerText: 'Task', width: 200 },
  {
    field: 'assignee',
    headerText: 'Owner',
    width: 90,
    align: 'center',
    template: ({ value }) => (
      <span style={{
        display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
        width: 26, height: 26, borderRadius: '50%',
        background: '#dbeafe', color: '#1d4ed8', fontWeight: 600, fontSize: 11,
      }}>
        {String(value ?? '?').charAt(0)}
      </span>
    ),
  },
  {
    field: 'progress',
    headerText: '%',
    width: 55,
    align: 'center',
    template: ({ value }) => (
      <span style={{ color: value === 100 ? '#10b981' : '#6b7280', fontWeight: 600 }}>
        {value}%
      </span>
    ),
  },
];

<GanttChart tasks={tasks} columns={columns} fieldsPanelWidth={360} height={400} />

Sprint / Resource Planning

Use extra data fields with column templates to show metadata like priority or task type alongside the timeline.

Sprint Backlog View

Task
Assignee
Priority
Sprint Planning
Team
—
Feature: Auth
Alice
High
Feature: Dashboard
Bob
High
Bug Fixes
Carol
Critical
Code Review
Dave
—
Documentation
Eve
—
Sprint Review
Team
—
Sprint Retrospective
Team
—
November 2026
December 2026
10Tue
11Wed
12Thu
13Fri
14Sat
15Sun
16Mon
17Tue
18Wed
19Thu
20Fri
21Sat
22Sun
23Mon
24Tue
25Wed
26Thu
27Fri
28Sat
29Sun
30Mon
1Tue
2Wed
3Thu
4Fri
5Sat
6Sun
7Mon
8Tue
9Wed
10Thu
11Fri
12Sat
Sprint Start
Sprint End
Sprint Planning
Feature: Auth
Feature: Dashboard
Bug Fixes
Code Review
Documentation
Sprint Review
Sprint Retrospective
const tasks: GanttTask[] = [
  {
    id: 'feature-auth',
    name: 'Feature: Auth',
    start: '2025-01-06',
    end: '2025-01-14',
    progress: 75,
    assignee: 'Alice',
    data: { priority: 'High', type: 'Dev' },
  },
  // ...
];

const columns: GanttColumn[] = [
  { field: 'name', headerText: 'Task', width: 180 },
  { field: 'assignee', headerText: 'Assignee', width: 80, align: 'center' },
  {
    field: 'data.priority',
    headerText: 'Priority',
    width: 75,
    align: 'center',
    template: ({ task }) => {
      const priority = (task.data as any)?.priority;
      const colors = { Critical: '#ef4444', High: '#f59e0b', Medium: '#3b82f6' };
      return (
        <span style={{
          padding: '1px 6px', borderRadius: 10, fontSize: 10, fontWeight: 600,
          background: `${colors[priority]}20`, color: colors[priority],
        }}>
          {priority}
        </span>
      );
    },
  },
];

// Mark weekends as holidays
const isHoliday = (date: Date) => date.getDay() === 0 || date.getDay() === 6;

<GanttChart
  tasks={tasks}
  columns={columns}
  fieldsPanelWidth={360}
  isHoliday={isHoliday}
  markers={[
    { date: sprintStart, label: 'Sprint Start', color: '#3b82f6' },
    { date: sprintEnd,   label: 'Sprint End',   color: '#f59e0b' },
  ]}
  height={420}
/>

Quarterly / Annual View

Use viewMode="quarter" or "year" for roadmap-level planning across many months.

Quarterly Roadmap

Initiative
Q1 — Foundation
Infrastructure Setup
Core Platform
Q2 — Growth
Feature A
Feature B
Mobile App
Q3 — Scale
Performance
Enterprise
v1.0 Launch
v2.0 Launch
2026
2027
Aug
Sep
Oct
Nov
Dec
Jan
Feb
Mar
Apr
May
Q1 — Foundation
Infrastructure Setup
Core Platform
Q2 — Growth
Feature A
Feature B
Mobile App
Q3 — Scale
Performance
Enterprise
<GanttChart
  tasks={roadmapTasks}
  viewMode="month"    // or "quarter" | "year" for wider ranges
  height={400}
  columns={[{ field: 'name', headerText: 'Initiative', width: 200 }]}
/>

Read-Only Mode

Set readOnly to disable all interactions. Useful for dashboards and reports.

Read-Only Gantt

Task Name
Project Kickoff
Requirements Gathering
UI Design
Backend Development
Testing & QA
Deployment
November 2026
December 2026
12Thu
13Fri
14Sat
15Sun
16Mon
17Tue
18Wed
19Thu
20Fri
21Sat
22Sun
23Mon
24Tue
25Wed
26Thu
27Fri
28Sat
29Sun
30Mon
1Tue
2Wed
3Thu
4Fri
5Sat
6Sun
7Mon
8Tue
9Wed
10Thu
11Fri
12Sat
13Sun
14Mon
15Tue
16Wed
17Thu
18Fri
19Sat
20Sun
21Mon
22Tue
23Wed
Today
Sprint End
Release
Project Kickoff
Requirements Gathering
UI Design
Backend Development
Testing & QA
Deployment
<GanttChart
  tasks={tasks}
  height={400}
  readOnly={true}
/>

Timeline-Only View

Hide the left fields panel entirely with showFieldsPanel={false} for a compact timeline.

No Fields Panel

November 2026
December 2026
12Thu
13Fri
14Sat
15Sun
16Mon
17Tue
18Wed
19Thu
20Fri
21Sat
22Sun
23Mon
24Tue
25Wed
26Thu
27Fri
28Sat
29Sun
30Mon
1Tue
2Wed
3Thu
4Fri
5Sat
6Sun
7Mon
8Tue
9Wed
10Thu
11Fri
12Sat
13Sun
14Mon
15Tue
16Wed
17Thu
18Fri
19Sat
20Sun
21Mon
22Tue
23Wed
Today
Project Kickoff
Requirements Gathering
UI Design
Backend Development
Testing & QA
Deployment
<GanttChart
  tasks={tasks}
  height={300}
  showFieldsPanel={false}
/>

Import

import { GanttChart } from 'fluxo-ui';

// Type imports
import type {
  GanttTask,
  GanttColumn,
  GanttMarker,
  GanttDependency,
  GanttViewMode,
  GanttTaskChangeEvent,
  GanttTaskClickEvent,
  GanttTaskCreateEvent,
  GanttColumnTemplateProps,
  TaskBarTemplateProps,
} from 'fluxo-ui';

GanttChart Props

tasksreq
GanttTask[]

Array of task objects to display on the chart

columns
GanttColumn[]"[{ field: 'name', headerText: 'Task Name', width: 200 }]"

Column definitions for the left fields panel

viewMode
'day' | 'week' | 'month' | 'quarter' | 'year'"'day'"

Controls how the timeline is rendered and grouped

startDate
Date | string

Override the auto-computed start date of the visible range

endDate
Date | string

Override the auto-computed end date of the visible range

height
number | string"500"

Total height of the Gantt chart container

rowHeight
number"40"

Height of each task row in pixels

columnWidth
number

Width of each timeline column. Defaults vary by view mode. With fillWidth it is the minimum width

fillWidth
boolean"true"

Widens the columns so the timeline fills the available width when it is narrower than the panel

fieldsPanelWidth
number | string"300"

Width of the left-side fields/columns panel

showFieldsPanel
boolean"true"

Toggle the left fields panel visibility

showToday
boolean"true"

Highlight today with a vertical line and scroll to it on mount

showDependencies
boolean"true"

Render SVG dependency arrows between tasks

showProgress
boolean"true"

Render the progress overlay on task bars

showTooltip
boolean"true"

Show hover tooltip with task details

markers
GanttMarker[]"[]"

Vertical date markers (deadlines, milestones, events). Labels are shown in a header row and stacked when they collide; labels that do not fit show as a tick with a tooltip

bands
GanttBand[]"[]"

Shaded date ranges behind the task bars (sprints, release windows, freeze periods) with an optional label in the header. Overlapping bands get their own header row, and shortLabel is shown when the label does not fit

isHoliday
(date: Date) => boolean

Callback to determine if a date should be marked as a holiday

allowTaskDrag
boolean"true"

Allow users to drag tasks to new dates

allowTaskResize
boolean"true"

Allow users to resize task bars from either end

allowTaskCreate
boolean"false"

Allow users to drag on empty rows to create new tasks

readOnly
boolean"false"

Disable all drag, resize, and create interactions

taskBarTemplate
(props: TaskBarTemplateProps) => ReactNode

Custom render function for task bar content

tooltipTemplate
(task: GanttTask) => ReactNode

Custom render function for the hover tooltip

onTaskChange
(event: GanttTaskChangeEvent) => void

Fires when a task is moved or resized

onTaskClick
(event: GanttTaskClickEvent) => void

Fires when a task bar is clicked

onTaskDoubleClick
(event: GanttTaskClickEvent) => void

Fires when a task bar is double-clicked

onTaskCreate
(event: GanttTaskCreateEvent) => void

Fires when a new task range is drawn (requires allowTaskCreate)

onViewModeChange
(mode: GanttViewMode) => void

Fires when the user switches the view mode

onExpandToggle
(task: GanttTask, expanded: boolean) => void

Fires when a group task is expanded or collapsed

allowDependencyCreate
boolean"false"

Shows a connector on each bar that can be dragged onto another bar to create a dependency (requires onDependencyCreate)

onSegmentChange
(event: GanttSegmentChangeEvent) => void

Called after a segment of a task is moved or resized

onSegmentClick
(event: GanttSegmentClickEvent) => void

Called when a segment of a task is clicked

onSegmentDoubleClick
(event: GanttSegmentClickEvent) => void

Called when a segment of a task is double-clicked

onDependencyCreate
(event: GanttDependencyCreateEvent) => void

Called when a dependency is drawn from one bar (fromTask) to another (toTask)

onDependencyClick
(event: GanttDependencyClickEvent) => void

Makes dependency lines clickable, for example to remove a dependency

GanttTask Properties

idreq
string

Unique identifier for the task

namereq
string

Display name of the task

startreq
Date | string

Start date of the task

endreq
Date | string

End date of the task

progress
number"0"

Completion percentage (0-100)

type
'task' | 'milestone' | 'group'"'task'"

Determines visual style and behavior

color
string

Custom background color for the task bar

textColor
string

Custom text color inside the task bar

dependencies
GanttDependency[]

Array of dependency connections to other tasks

children
GanttTask[]

Nested child tasks (makes this task a group/parent)

collapsed
boolean"false"

Whether this group is initially collapsed

assignee
string

Assignee name shown in tooltip and custom columns

draggable
boolean"true"

Override draggability for this specific task

resizable
boolean"true"

Override resizability for this specific task

tooltip
ReactNode | ((task: GanttTask) => ReactNode)

Custom tooltip content for this task

data
Record<string, unknown>

Arbitrary extra data accessible in templates

segments
GanttSegment[]

Several bars on the same row (for example work split into phases). The task start and end still define its overall span

Features

View Modes

5 built-in scales: Day, Week, Month, Quarter, Year with smart header grouping

Drag & Drop

Move tasks and resize from both ends with live visual feedback

Task Creation

Draw new tasks by clicking and dragging on empty row space

Hierarchical Tasks

Unlimited nesting depth with expand/collapse support

Task Types

Regular tasks, group/summary bars with caps, and diamond milestones

Dependencies

4 dependency types (FS, SS, FF, SF) rendered as curved SVG arrows

Progress Bars

Visual completion overlay on each task bar

Date Markers

Labelled vertical lines for deadlines, sprints, and events

Custom Columns

Any field from task data with full JSX template support

Custom Tooltips

Per-task or global tooltip template override

Holiday Support

isHoliday callback colors non-working days differently

Scroll Sync

Left and right panels stay vertically synchronized

Theming

Full dark/light + 5 brand themes via CSS variables — zero extra config

Responsive

Fields panel auto-hides on mobile, toolbar wraps on small screens

Accessibility

ARIA labels, keyboard focus, semantic roles on all interactive elements

Performance

React.memo, useMemo, useCallback throughout — handles large datasets