Jaeung Kim Logo

React component library

@jaeungkim/gantt-chart

Lightweight, high-performance Gantt chart UI for React applications with virtualization, editable dependencies, and a minimal API surface.

Installation

npm install @jaeungkim/gantt-chart

Features

Timeline scales

Day, week, month, and year views with matching drag intervals.

Virtualized rendering

Keeps large task sets responsive by rendering only what is visible.

Dependency support

Supports FS, SS, FF, and SF relationships with auto-routed connectors.

Interactive editing

Drag bars, resize edges, and push updates back through a single callback.

Theme-aware

Fits light, dark, and system themes without extra wrapper code.

Minimal API surface

The exported component stays small enough to drop into product code quickly.

Usage

App.tsx
import { ReactGanttChart } from "@jaeungkim/gantt-chart";
import type { Task } from "@jaeungkim/gantt-chart";
const tasks: Task[] = [
{
id: "1",
name: "Project Kickoff",
startDate: "2024-06-01T09:00:00Z",
endDate: "2024-06-03T17:00:00Z",
parentId: null,
sequence: "1",
dependencies: [],
},
{
id: "2",
name: "Requirements Gathering",
startDate: "2024-06-04T09:00:00Z",
endDate: "2024-06-10T17:00:00Z",
parentId: null,
sequence: "2",
dependencies: [{ targetId: "1", type: "FS" }],
},
];
export default function App() {
return (
<ReactGanttChart
tasks={tasks}
height={600}
width="100%"
theme="system"
defaultScale="month"
onTasksChange={(updatedTasks) => console.log(updatedTasks)}
/>
);
}

Task Format

All dates should be passed as UTC ISO strings such as 2024-06-01T09:00:00Z.

types.ts
interface Task {
id: string;
name: string;
startDate: string; // UTC ISO string
endDate: string; // UTC ISO string
parentId: string | null;
sequence: string;
dependencies?: TaskDependency[];
}
interface TaskDependency {
targetId: string;
type: DependencyType;
}
type DependencyType = "FS" | "SS" | "FF" | "SF";
// FS = Finish-to-Start
// SS = Start-to-Start
// FF = Finish-to-Finish
// SF = Start-to-Finish

Live Demo

Drag bars, resize edges, and switch scales to test the interaction model.

gantt-chart-demo

Props

PropTypeDefaultDescription
tasksTask[][]Array of task objects to render.
onTasksChange(tasks) => voidundefinedReceives updated task data after edits.
heightnumber | string600Chart height in pixels or any CSS length.
widthnumber | string"100%"Chart width in pixels or any CSS length.
theme"light" | "dark" | "system""system"Theme mode applied inside the chart.
defaultScale"day" | "week" | "month" | "year""month"Initial visible timeline scale.
classNamestringundefinedAdditional class name for the outer wrapper.

Timeline Scales

The scale switcher in the chart header controls the visible timeline density.

ScaleHeader LabelTick UnitDrag Step
dayDayHour1 hour
weekWeekDay6 hours
monthMonthDay1 day
yearYearMonth7 days

Questions or feedback? Open an issue and I’ll take a look.

Open an issue