Gantt Chart for React
A React Gantt chart puts a plan on a timeline, with progress, dependency arrows, milestones and a today line. Pass tasks as a readonly GanttTask[]: an id, a label, a start and an end day, plus optional progress and dependencies.
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/gantt-chart.jsonSprint 14
GanttChartGanttTabledefaultGanttChartLabels- +1 more
Product launch plan
Four phases, twelve tasks. Hover a bar: its arrows light up and the tooltip lists dates, progress and what it waits for. Collapse a phase and the rows below glide up. It opens at the zoom that fits the whole plan; switch the zoom and the timeline glides around the date in the middle, and an edge fades while there is more plan beyond it.
Sheen 2.0 launch plan
Feb – Apr 2026
- Discovery
- Design
- Build
- Launch
import { ChartCard } from "@/components/sheenui/charts/chart-parts/chart-card";
import { GanttChart } from "@/components/sheenui/charts/gantt-chart";
import { ganttLegend } from "@/components/sheenui/charts/gantt/model";
import { GanttTable } from "@/components/sheenui/charts/gantt/table";
import { type GanttTask } from "@/components/sheenui/charts/gantt/types";
// Package build (after the first npm release, or a packed tarball): import { ChartCard, ganttLegend, GanttTable, GanttChart, type GanttTask } from "@sheenui/theme";
const plan: GanttTask[] = [
{ id: "research", label: "User research", group: "Discovery", start: "2026-02-02", end: "2026-02-13", progress: 1 },
{ id: "scope", label: "Scope sign-off", group: "Discovery", start: "2026-02-20", milestone: true, dependencies: ["research"] },
{ id: "ui", label: "UI design", group: "Design", start: "2026-03-02", end: "2026-03-20", progress: 0.8, dependencies: ["scope"] },
// …
];
<ChartCard
title="Launch plan"
legend={ganttLegend(plan)}
table={<GanttTable tasks={plan} />}
>
<GanttChart tasks={plan} today="2026-03-18" aria-label="Product launch plan" />
</ChartCard>Files to copy
14 folders · 30 files · 4 packages
- From
theme/src/ components/charts/{gantt-chart.tsx, calendar-heatmap.tsx, chart-export-menu.tsx, chart-export.ts, chart-figure.tsx, chart-fit.tsx, chart-icons.tsx, chart-parts.tsx, chart-patterns.tsx, chart-pointer.tsx, chart-tip.tsx, chart-utils.ts, heatmap.tsx}components/charts/chart-parts/components/charts/gantt/components/charts/heatmap/components/drawer/parts/sheet.tsxcomponents/kbd/components/menu/components/segmented/components/skeleton/components/status-icons/hooks/{use-controllable.ts, use-direction.ts, use-intersection.ts, use-latest.ts, use-media-query.ts, use-preferences.ts}motion/tokens.tslib/{cn.ts, csv.ts, form.ts, glide-highlight.tsx, heading.ts, math.ts, popup-a11y.ts, popup-motion.ts, warn-once.ts}styles/
- shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/gantt-chart.jsonRegistry item: gantt-chart. The styles need the Tailwind v4 glass UI setup.- The examples also use
components/spinner/components/toast/lib/state-light.tsx
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/toast.json- Packages
pnpm add @base-ui/react clsx motion tailwind-merge
Next.js: samples here pass functions (formatters, seriesLegend, a dashboard's load), so put them in a file that starts with "use client".
Sprint, by day
defaultScale="day" for a two-week sprint: weekends are shaded, today’s date is highlighted in the header and the plan stretches to fill the width. Click a bar (or press Enter on it) to open the task.
Sprint 14
Mar 16 – 27, 2026 (two weeks)
import { GanttChart } from "@/components/sheenui/charts/gantt-chart";
import { type GanttTask } from "@/components/sheenui/charts/gantt/types";
import { useToast } from "@/components/sheenui/toast/toast";
// Package build (after the first npm release, or a packed tarball): import { GanttChart, useToast, type GanttTask } from "@sheenui/theme";
// This example also uses toast: npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/toast.json
const sprint: GanttTask[] = [
{ id: "a", label: "Audit chart tokens", start: "2026-03-16", end: "2026-03-17", progress: 1, assignee: "Ravi" },
{ id: "b", label: "Token cleanup", start: "2026-03-17", end: "2026-03-19", progress: 1, dependencies: ["a"], assignee: "Ravi" },
{ id: "c", label: "Gantt zoom levels", start: "2026-03-18", end: "2026-03-23", progress: 0.5, assignee: "Leo" },
{ id: "d", label: "Cohort grid keyboard", start: "2026-03-19", end: "2026-03-24", progress: 0.3, dependencies: ["b"], assignee: "Aiko" },
{ id: "f", label: "Sprint review", start: "2026-03-26", milestone: true, dependencies: ["c", "d"] },
];
export function Example() {
const toast = useToast();
return (
<GanttChart
tasks={sprint}
defaultScale="day"
today="2026-03-20"
onTaskClick={(task) => toast.info(task.label)}
aria-label="Sprint 14 plan"
/>
);
}Props
GanttChartLabels keys and English defaults (22)
GanttTable props
Keyboard
Accessibility
- The timeline is one focusable figure (role description “Gantt chart”); each keyboard move is announced once: name, dates, duration, progress, dependencies and owner.
- Phase rows are disclosure buttons with aria-expanded.
- Colors follow the phase in a fixed slot; the phase also shows as a dot and a label, never by color alone.
- The Table view lists every task with start, end, duration, progress, owner and dependencies.
- Right-to-left pages mirror the timeline: time runs leftwards and the names sit on the right.
- Reduced motion: no cascade, no glides; zoom and scrolling jump.
All exports on this page
GanttChart— Gantt chart: tasks as bars on a timeline, with progress, finish-to-start dependency arrows, milestones, collapsible phases and a today line.GanttTable— Every task as a row: phase, start, end, duration, progress, owner and what it waits for.defaultGanttChartLabels— The built-in English strings of GanttChart; spread it into your own labels and change what you need.
When to use the gantt chart
- Use it as a project timeline chart: a plan with tasks as bars on a timeline, progress fills, finish-to-start dependency arrows, milestones and a today line, such as a product launch schedule.
- Group tasks by phase or team: groups become collapsible rows and set the bar color, so a long plan can fold down to its phases for a status meeting.
- Switch between day, week and month zoom with the toolbar, and use scale with onScaleChange when your own control should drive it; it opens at the most detailed zoom that fits the plan.
- Skip it when you only need to show one task's completion, where Progress is enough, or when you need only a due date, where a Calendar or a plain Badge is lighter.
- Pair it with ChartCard and GanttTable for a text view, plus Dialog or Drawer opened from onTaskClick to edit a task.
Frequently asked questions
Related pages
48 charts pages in all: browse them on Charts.
By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .