Gantt Chart
NewTasks over days with progress, milestones, weekends, a today line and pinned names. No date library.
Click a bar or milestone
Installation
$ pnpm dlx shadcn@latest add @synccn/gantt-chartFirst time in this project? Connect synccn with one command.
Usage
import { GanttChart } from "@/components/ui/gantt-chart";<GanttChart tasks={tasks} onTaskClick={open} />API reference
Generated from the component's TypeScript types, so it always matches the code.
GanttChart
Timeline of tasks over days: bars with progress, milestones, weekends shaded, a today line and month headers. Scrolls sideways while names stay pinned. No date library needed.
- tasksrequired
GanttTask[]—
- dayWidth
numberDefault
28Width of one day in pixels.
- onTaskClick
(task: GanttTask) => voidCalled when a bar is clicked.
- showToday
booleanDefault
trueDraws a line on today.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
npm packages
- clsx for cn()
- tailwind-merge for cn()
Keyboard
- TabMove between tasks
- EnterOpen a task
Accessibility
- Each bar is a button labelled with its name, dates and progress.
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA attributes: aria-label