@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-chartFeatures
📆
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-FinishLive Demo
Interactive preview — drag bars to move, resize edges, switch timeline scales
gantt-chart-demo
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| tasks | Task[] | [] | Array of task objects |
| onTasksChange | (tasks) => void | - | Callback when tasks change |
| height | number | string | 600 | Chart height (px or CSS) |
| width | number | string | "100%" | Chart width (px or CSS) |
| theme | "light" | "dark" | "system" | - | Theme mode |
| defaultScale | "day" | "week" | "month" | "year" | "month" | Initial timeline scale |
| className | string | - | Additional CSS class |
Timeline Scales
| Scale | Header Label | Tick Unit | Drag Step |
|---|---|---|---|
| day | Day | Hour | 1 hour |
| week | Week | Day | 6 hours |
| month | Month | Day | 1 day |
| year | Year | Month | 7 days |
Switch scales using the dropdown at the top-right of the chart.
Question? Give us feedback →
Open an issue on GitHub