@jaeungkim/gantt-chart

Lightweight, high-performance Gantt chart component for React applications. Designed for fast rendering with virtualization and clean, minimal aesthetics.

Installation

npm install @jaeungkim/gantt-chart

Features

📆

Timeline Scales

Day, Week, Month, Year views

🔄

Drag & Resize

Move bars, resize edges, snap to intervals

🧲

Smart Dependencies

FS, SS, FF, SF arrows with auto-routing

Virtualized

Only visible rows render for 60fps

🌙

Theming

Light, Dark, and System theme support

📍

Today Marker

Visual indicator for current date

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="100vh"
width="100%"
theme="system"
defaultScale="month"
onTasksChange={(updated) => console.log(updated)}
/>
);
}

Task Format

All dates must be in UTC ISO string format: "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

Interactive preview — drag bars to move, resize edges, switch timeline scales

gantt-chart-demo

Props

PropTypeDefaultDescription
tasksTask[][]Array of task objects
onTasksChange(tasks) => void-Callback when tasks change
heightnumber | string600Chart height (px or CSS)
widthnumber | string"100%"Chart width (px or CSS)
theme"light" | "dark" | "system"-Theme mode
defaultScale"day" | "week" | "month" | "year""month"Initial timeline scale
classNamestring-Additional CSS class

Timeline Scales

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

Switch scales using the dropdown at the top-right of the chart.

Question? Give us feedback →

Open an issue on GitHub